From: <mar...@us...> - 2009-05-19 12:43:32
|
Revision: 265 http://gridsim.svn.sourceforge.net/gridsim/?rev=265&view=rev Author: marcos_dias Date: 2009-05-19 12:18:14 +0000 (Tue, 19 May 2009) Log Message: ----------- Changes from 4.2 to 5.0 - Improvements to make GridSim more compatible with Java 5 and 6 - Changes in SimJava to enable a simulation to be paused and resumed. - Add a new package (i.e. gridsim.parallel) that provides: * A graphical user interface for debugging resource allocation policies * several allocation policies for scheduling parallel jobs on clusters and and supercomputers. The policies include aggressive backfilling, conservative backfilling, advance reservation with conservative backfilling, selective backfilling and agressive backfilling with multiple resource partitions. * A workload model by Lublin and Feitelson for generating jobs for grid resources. * A data structure to facilitate the scheduling of jobs and advance reservations. * Logging features using Java logging API. Modified Paths: -------------- trunk/build.xml trunk/changelog.txt trunk/jars/simjava2.jar trunk/release_note.txt trunk/source/gridsim/ARGridResource.java trunk/source/gridsim/ARObject.java trunk/source/gridsim/ARPolicy.java trunk/source/gridsim/ARSimpleSpaceShared.java trunk/source/gridsim/Accumulator.java trunk/source/gridsim/AdvanceReservation.java trunk/source/gridsim/AllocPolicy.java trunk/source/gridsim/GridInformationService.java trunk/source/gridsim/GridResource.java trunk/source/gridsim/GridSim.java trunk/source/gridsim/GridSimCore.java trunk/source/gridsim/GridSimRandom.java trunk/source/gridsim/GridSimShutdown.java trunk/source/gridsim/GridSimStandardPE.java trunk/source/gridsim/GridSimTags.java trunk/source/gridsim/GridStatistics.java trunk/source/gridsim/GridUser.java trunk/source/gridsim/Gridlet.java trunk/source/gridsim/GridletList.java trunk/source/gridsim/IO_data.java trunk/source/gridsim/Machine.java trunk/source/gridsim/MachineList.java trunk/source/gridsim/PE.java trunk/source/gridsim/PEList.java trunk/source/gridsim/ParameterException.java trunk/source/gridsim/ResGridlet.java trunk/source/gridsim/ResGridletList.java trunk/source/gridsim/ResourceCalendar.java trunk/source/gridsim/ResourceCharacteristics.java trunk/source/gridsim/ResourceUserList.java trunk/source/gridsim/Sim_from_port.java trunk/source/gridsim/Stat.java trunk/source/gridsim/auction/AuctionTags.java trunk/source/gridsim/datagrid/DataGridResource.java trunk/source/gridsim/datagrid/DataGridTags.java trunk/source/gridsim/datagrid/DataGridUser.java trunk/source/gridsim/datagrid/DataGridlet.java trunk/source/gridsim/datagrid/File.java trunk/source/gridsim/datagrid/FileAttribute.java trunk/source/gridsim/datagrid/ReplicaManager.java trunk/source/gridsim/datagrid/SimpleReplicaManager.java trunk/source/gridsim/datagrid/filter/FileNameFilter.java trunk/source/gridsim/datagrid/filter/Filter.java trunk/source/gridsim/datagrid/filter/FilterDataResult.java trunk/source/gridsim/datagrid/index/AbstractRC.java trunk/source/gridsim/datagrid/index/DataGIS.java trunk/source/gridsim/datagrid/index/DataRegionalGIS.java trunk/source/gridsim/datagrid/index/RegionalRC.java trunk/source/gridsim/datagrid/index/TopRegionalRC.java trunk/source/gridsim/datagrid/storage/HarddriveStorage.java trunk/source/gridsim/datagrid/storage/Storage.java trunk/source/gridsim/datagrid/storage/TapeStorage.java trunk/source/gridsim/filter/FilterCreateAR.java trunk/source/gridsim/filter/FilterGridlet.java trunk/source/gridsim/filter/FilterQueryTimeAR.java trunk/source/gridsim/filter/FilterResult.java trunk/source/gridsim/net/fnb/FIFO.java trunk/source/gridsim/net/fnb/FnbSCFQScheduler.java trunk/source/gridsim/net/fnb/FnbWhiteList.java trunk/source/gridsim/net/fnb/RED.java trunk/source/gridsim/resFailure/AllocPolicyWithFailure.java trunk/source/gridsim/resFailure/AvailabilityInfo.java trunk/source/gridsim/resFailure/FailureMsg.java trunk/source/gridsim/resFailure/GridResourceWithFailure.java trunk/source/gridsim/resFailure/RegionalGISWithFailure.java trunk/source/gridsim/resFailure/SpaceSharedWithFailure.java trunk/source/gridsim/resFailure/TimeSharedWithFailure.java trunk/source/gridsim/util/HyperExponential.java trunk/source/gridsim/util/LCGRandom.java trunk/source/gridsim/util/NetworkReader.java trunk/source/gridsim/util/Workload.java Added Paths: ----------- trunk/examples/ResFailure/ trunk/examples/ResFailure/example01/ trunk/examples/ResFailure/example01/Ex01_Regional_GIS trunk/examples/ResFailure/example01/Ex01_Res_0 trunk/examples/ResFailure/example01/Ex01_Res_1 trunk/examples/ResFailure/example01/Ex01_Res_2 trunk/examples/ResFailure/example01/Ex01_User0 trunk/examples/ResFailure/example01/Ex01_User0_Fin trunk/examples/ResFailure/example01/GridUserFailureEx01.java trunk/examples/ResFailure/example01/GridletSubmission.java trunk/examples/ResFailure/example01/ResFailureEx01.java trunk/examples/ResFailure/example01/network_ex01.txt trunk/examples/ResFailure/example01/output.txt trunk/examples/ResFailure/example01/readme.txt trunk/examples/ResFailure/example02/ trunk/examples/ResFailure/example02/Ex02_Regional_GIS trunk/examples/ResFailure/example02/Ex02_Res_0 trunk/examples/ResFailure/example02/Ex02_Res_1 trunk/examples/ResFailure/example02/Ex02_Res_2 trunk/examples/ResFailure/example02/Ex02_Res_3 trunk/examples/ResFailure/example02/Ex02_Res_4 trunk/examples/ResFailure/example02/Ex02_Res_5 trunk/examples/ResFailure/example02/Ex02_User_0 trunk/examples/ResFailure/example02/GridUserFailureEx02.java trunk/examples/ResFailure/example02/GridletSubmission.java trunk/examples/ResFailure/example02/ResFailureEx02.java trunk/examples/ResFailure/example02/network_ex02.txt trunk/examples/ResFailure/example02/output.txt trunk/examples/ResFailure/example02/readme.txt trunk/examples/ResFailure/example03/ trunk/examples/ResFailure/example03/Ex03_Regional_GIS_0 trunk/examples/ResFailure/example03/Ex03_Regional_GIS_1 trunk/examples/ResFailure/example03/Ex03_Regional_GIS_2 trunk/examples/ResFailure/example03/Ex03_Res_0 trunk/examples/ResFailure/example03/Ex03_Res_10 trunk/examples/ResFailure/example03/Ex03_Res_12 trunk/examples/ResFailure/example03/Ex03_Res_14 trunk/examples/ResFailure/example03/Ex03_Res_2 trunk/examples/ResFailure/example03/Ex03_Res_4 trunk/examples/ResFailure/example03/Ex03_Res_6 trunk/examples/ResFailure/example03/Ex03_Res_8 trunk/examples/ResFailure/example03/Ex03_User_0 trunk/examples/ResFailure/example03/GridUserFailureEx03.java trunk/examples/ResFailure/example03/GridletSubmission.java trunk/examples/ResFailure/example03/ResFailureEx03.java trunk/examples/ResFailure/example03/network_ex03.txt trunk/examples/ResFailure/example03/output.txt trunk/examples/ResFailure/example03/readme.txt trunk/examples/ResFailure/readme.txt trunk/examples/WorkloadTrace/ trunk/examples/WorkloadTrace/custom_trace.txt trunk/examples/WorkloadTrace/example01/ trunk/examples/WorkloadTrace/example01/TraceEx01.java trunk/examples/WorkloadTrace/example01/output.txt trunk/examples/WorkloadTrace/example01/readme.txt trunk/examples/WorkloadTrace/example02/ trunk/examples/WorkloadTrace/example02/TraceEx02.java trunk/examples/WorkloadTrace/example02/User.java trunk/examples/WorkloadTrace/example02/output.txt trunk/examples/WorkloadTrace/example02/readme.txt trunk/examples/WorkloadTrace/example03/ trunk/examples/WorkloadTrace/example03/NetUser.java trunk/examples/WorkloadTrace/example03/TraceEx03.java trunk/examples/WorkloadTrace/example03/output.txt trunk/examples/WorkloadTrace/example03/readme.txt trunk/examples/WorkloadTrace/l_lanl_o2k.swf.txt trunk/examples/WorkloadTrace/l_sdsc_blue.swf.txt trunk/examples/WorkloadTrace/readme.txt trunk/examples/auction/ trunk/examples/auction/example01/ trunk/examples/auction/example01/AuctionResource.java trunk/examples/auction/example01/Broker.java trunk/examples/auction/example01/ExampleAuction.java trunk/examples/auction/example01/ResponderImpl.java trunk/examples/auction/example01/output.txt trunk/examples/auction/example02/ trunk/examples/auction/example02/AuctionResource.java trunk/examples/auction/example02/Broker.java trunk/examples/auction/example02/ExampleAuction.java trunk/examples/auction/example02/NetUser.java trunk/examples/auction/example02/ResponderImpl.java trunk/examples/auction/example02/output.txt trunk/examples/auction/example03/ trunk/examples/auction/example03/AuctionResource.java trunk/examples/auction/example03/Broker.java trunk/examples/auction/example03/ExampleAuction.java trunk/examples/auction/example03/NetUser.java trunk/examples/auction/example03/ResponderImpl.java trunk/examples/auction/example03/output.txt trunk/examples/auction/example_of_use.pdf trunk/examples/auction/readme.txt trunk/examples/datagrid/ trunk/examples/datagrid/example01/ trunk/examples/datagrid/example01/DataExample1.java trunk/examples/datagrid/example01/DummyUser.java trunk/examples/datagrid/example01/output.txt trunk/examples/datagrid/example01/readme.txt trunk/examples/datagrid/example02/ trunk/examples/datagrid/example02/DataExample2.java trunk/examples/datagrid/example02/FileUser.java trunk/examples/datagrid/example02/output.txt trunk/examples/datagrid/example02/readme.txt trunk/examples/datagrid/example03/ trunk/examples/datagrid/example03/DataGridletExample.java trunk/examples/datagrid/example03/DataGridletUser.java trunk/examples/datagrid/example03/output.txt trunk/examples/datagrid/example03/readme.txt trunk/examples/datagrid/example04/ trunk/examples/datagrid/example04/DataGridSim.java trunk/examples/datagrid/example04/FilesReader.java trunk/examples/datagrid/example04/ParameterReader.java trunk/examples/datagrid/example04/ResourceReader.java trunk/examples/datagrid/example04/SimUser.java trunk/examples/datagrid/example04/UserReader.java trunk/examples/datagrid/example04/files.txt trunk/examples/datagrid/example04/network.txt trunk/examples/datagrid/example04/output.txt trunk/examples/datagrid/example04/parameters.txt trunk/examples/datagrid/example04/readme.txt trunk/examples/datagrid/example04/resources.txt trunk/examples/datagrid/example04/users.txt trunk/examples/datagrid/tutorial/ trunk/examples/datagrid/tutorial/Simulation.html trunk/examples/datagrid/tutorial/connectEntities.html trunk/examples/datagrid/tutorial/createNetwork.html trunk/examples/datagrid/tutorial/createTopLevelRC.html trunk/examples/datagrid/tutorial/createUsers.html trunk/examples/datagrid/tutorial/creatingResources.html trunk/examples/datagrid/tutorial/design_architecture.html trunk/examples/datagrid/tutorial/getting_started.html trunk/examples/datagrid/tutorial/img/ trunk/examples/datagrid/tutorial/img/CentralRC.png trunk/examples/datagrid/tutorial/img/ExampleTopology.png trunk/examples/datagrid/tutorial/img/Resource.png trunk/examples/datagrid/tutorial/img/TwoLevelRC1.png trunk/examples/datagrid/tutorial/img/TwoLevelRC2.png trunk/examples/datagrid/tutorial/img/logo.png trunk/examples/datagrid/tutorial/index.html trunk/examples/datagrid/tutorial/initialization.html trunk/examples/datagrid/tutorial/writingRC.html trunk/examples/datagrid/tutorial/writingRM.html trunk/examples/gridsim/ trunk/examples/gridsim/example01/ trunk/examples/gridsim/example01/Example1.java trunk/examples/gridsim/example01/readme.txt trunk/examples/gridsim/example02/ trunk/examples/gridsim/example02/Example2.java trunk/examples/gridsim/example02/readme.txt trunk/examples/gridsim/example03/ trunk/examples/gridsim/example03/Example3.java trunk/examples/gridsim/example03/Test.java trunk/examples/gridsim/example03/output.txt trunk/examples/gridsim/example03/readme.txt trunk/examples/gridsim/example04/ trunk/examples/gridsim/example04/Example4.java trunk/examples/gridsim/example04/GridSim_stat.txt trunk/examples/gridsim/example04/output.txt trunk/examples/gridsim/example04/readme.txt trunk/examples/gridsim/example05/ trunk/examples/gridsim/example05/Example5.java trunk/examples/gridsim/example05/GridSim_stat.txt trunk/examples/gridsim/example05/output.txt trunk/examples/gridsim/example05/readme.txt trunk/examples/gridsim/example06/ trunk/examples/gridsim/example06/Example6.java trunk/examples/gridsim/example06/GridSim_stat.txt trunk/examples/gridsim/example06/output.txt trunk/examples/gridsim/example06/readme.txt trunk/examples/gridsim/example07/ trunk/examples/gridsim/example07/Test.java trunk/examples/gridsim/example07/TestCase1.java trunk/examples/gridsim/example07/TestCase2.java trunk/examples/gridsim/example07/TestCase3.java trunk/examples/gridsim/example07/TestCase4.java trunk/examples/gridsim/example07/TestCase5.java trunk/examples/gridsim/example07/TestCase6.java trunk/examples/gridsim/example07/TestCase7.java trunk/examples/gridsim/example07/TestCase8.java trunk/examples/gridsim/example07/outputSpaceCase8.txt trunk/examples/gridsim/example07/outputTimeCase5.txt trunk/examples/gridsim/example07/readme.txt trunk/examples/gridsim/example08/ trunk/examples/gridsim/example08/Example8.java trunk/examples/gridsim/example08/NewPolicy.java trunk/examples/gridsim/example08/output.txt trunk/examples/gridsim/example08/readme.txt trunk/examples/gridsim/example09/ trunk/examples/gridsim/example09/Example9.java trunk/examples/gridsim/example09/NewGIS.java trunk/examples/gridsim/example09/NewGridResource.java trunk/examples/gridsim/example09/output.txt trunk/examples/gridsim/example09/readme.txt trunk/examples/gridsim/example10/ trunk/examples/gridsim/example10/ARTest.java trunk/examples/gridsim/example10/Example10.java trunk/examples/gridsim/example10/readme.txt trunk/examples/gridsim/regionalGIS/ trunk/examples/gridsim/regionalGIS/ExampleGIS.java trunk/examples/gridsim/regionalGIS/NetUserGIS.java trunk/examples/gridsim/regionalGIS/output.txt trunk/examples/gridsim/regionalGIS/readme.txt trunk/examples/network/ trunk/examples/network/FiniteBuffer/ trunk/examples/network/FiniteBuffer/FnbUser.java trunk/examples/network/FiniteBuffer/GridletSubmission.java trunk/examples/network/FiniteBuffer/mainExample.java trunk/examples/network/FiniteBuffer/network_example.txt trunk/examples/network/FiniteBuffer/readme.txt trunk/examples/network/example01/ trunk/examples/network/example01/NetEx01.java trunk/examples/network/example01/NetUser.java trunk/examples/network/example01/Test.java trunk/examples/network/example01/output.txt trunk/examples/network/example01/readme.txt trunk/examples/network/example01/test.csv trunk/examples/network/example02/ trunk/examples/network/example02/NetEx02.java trunk/examples/network/example02/NetUser.java trunk/examples/network/example02/User_0.csv trunk/examples/network/example02/User_1.csv trunk/examples/network/example02/output.txt trunk/examples/network/example02/readme.txt trunk/examples/network/example02/router1_report.csv trunk/examples/network/example02/router2_report.csv trunk/examples/network/example03/ trunk/examples/network/example03/NetEx03.java trunk/examples/network/example03/NetUser.java trunk/examples/network/example03/User_0.csv trunk/examples/network/example03/User_1.csv trunk/examples/network/example03/output.txt trunk/examples/network/example03/readme.txt trunk/examples/network/example03/router1_report.csv trunk/examples/network/example03/router2_report.csv trunk/examples/network/flow/ trunk/examples/network/flow/example01/ trunk/examples/network/flow/example01/FlowNetEx01.java trunk/examples/network/flow/example01/FlowNetUser.java trunk/examples/network/flow/example01/FlowTest.java trunk/examples/network/flow/example01/output.txt trunk/examples/network/flow/example01/readme.txt trunk/examples/network/flow/example01/test1.csv trunk/examples/network/flow/example01/test2.csv trunk/examples/network/flow/example02/ trunk/examples/network/flow/example02/FlowNetEx02.java trunk/examples/network/flow/example02/FlowNetUser.java trunk/examples/network/flow/example02/User_0.csv trunk/examples/network/flow/example02/User_1.csv trunk/examples/network/flow/example02/output.txt trunk/examples/network/flow/example02/readme.txt trunk/examples/network/flow/example02/router1_report.csv trunk/examples/network/flow/example02/router2_report.csv trunk/examples/network/rate/ trunk/examples/network/rate/NetUser.java trunk/examples/network/rate/R1_report.csv trunk/examples/network/rate/RateExample.java trunk/examples/network/rate/network.txt trunk/examples/network/rate/output.txt trunk/examples/network/rate/readme.txt trunk/examples/network/readme.txt trunk/examples/network/scfq/ trunk/examples/network/scfq/NetUser.java trunk/examples/network/scfq/R1_report.csv trunk/examples/network/scfq/SCFQExample.java trunk/examples/network/scfq/network.txt trunk/examples/network/scfq/output.txt trunk/examples/network/scfq/readme.txt trunk/examples/parallel/ trunk/examples/parallel/agressive/ trunk/examples/parallel/agressive/ExampleEASY01.java trunk/examples/parallel/conservative/ trunk/examples/parallel/conservative/ExampleCB01.java trunk/examples/parallel/partitions/ trunk/examples/parallel/partitions/ExampleMulti01.java trunk/examples/parallel/partitions/ExampleMulti02.java trunk/examples/parallel/reservation/ trunk/examples/parallel/reservation/ARExample01.java trunk/examples/parallel/reservation/ARUser.java trunk/examples/parallel/sdsc_blue_01.txt trunk/examples/parallel/sdsc_blue_02.txt trunk/examples/parallel/selective/ trunk/examples/parallel/selective/ExampleSelective01.java trunk/examples/parallel/selective/ExampleSelective02.java trunk/examples/parallel/util/ trunk/examples/parallel/util/ExampleLublin99.java trunk/examples/readme.txt trunk/source/gridsim/parallel/ trunk/source/gridsim/parallel/ParallelResource.java trunk/source/gridsim/parallel/ResourceDynamics.java trunk/source/gridsim/parallel/SSGridlet.java trunk/source/gridsim/parallel/SSGridletList.java trunk/source/gridsim/parallel/gui/ trunk/source/gridsim/parallel/gui/AbstractVisualizer.java trunk/source/gridsim/parallel/gui/ActionType.java trunk/source/gridsim/parallel/gui/AllocationAction.java trunk/source/gridsim/parallel/gui/AllocationListener.java trunk/source/gridsim/parallel/gui/GUISettings.java trunk/source/gridsim/parallel/gui/JobTypePanel.java trunk/source/gridsim/parallel/gui/ParallelVisualizer.java trunk/source/gridsim/parallel/gui/ResourceWindow.java trunk/source/gridsim/parallel/gui/Visualizer.java trunk/source/gridsim/parallel/gui/VisualizerAdaptor.java trunk/source/gridsim/parallel/gui/gui.properties trunk/source/gridsim/parallel/log/ trunk/source/gridsim/parallel/log/LogFormatter.java trunk/source/gridsim/parallel/log/LoggerEnum.java trunk/source/gridsim/parallel/log/Logging.java trunk/source/gridsim/parallel/profile/ trunk/source/gridsim/parallel/profile/LinkedTreeMap.java trunk/source/gridsim/parallel/profile/PERange.java trunk/source/gridsim/parallel/profile/PERangeList.java trunk/source/gridsim/parallel/profile/PartProfile.java trunk/source/gridsim/parallel/profile/PartProfileEntry.java trunk/source/gridsim/parallel/profile/PartitionPredicate.java trunk/source/gridsim/parallel/profile/Profile.java trunk/source/gridsim/parallel/profile/ProfileEntry.java trunk/source/gridsim/parallel/profile/ResourcePartition.java trunk/source/gridsim/parallel/profile/ScheduleItem.java trunk/source/gridsim/parallel/profile/SingleProfile.java trunk/source/gridsim/parallel/profile/SingleProfileEntry.java trunk/source/gridsim/parallel/profile/TimeSlot.java trunk/source/gridsim/parallel/reservation/ trunk/source/gridsim/parallel/reservation/ErrorType.java trunk/source/gridsim/parallel/reservation/FilterARMessage.java trunk/source/gridsim/parallel/reservation/MessageType.java trunk/source/gridsim/parallel/reservation/Reservation.java trunk/source/gridsim/parallel/reservation/ReservationMessage.java trunk/source/gridsim/parallel/reservation/ReservationPolicy.java trunk/source/gridsim/parallel/reservation/ReservationRequester.java trunk/source/gridsim/parallel/reservation/ReservationStatus.java trunk/source/gridsim/parallel/reservation/ServerReservation.java trunk/source/gridsim/parallel/scheduler/ trunk/source/gridsim/parallel/scheduler/ARConservativeBackfill.java trunk/source/gridsim/parallel/scheduler/AggressiveBackfill.java trunk/source/gridsim/parallel/scheduler/AggressiveMultiPartitions.java trunk/source/gridsim/parallel/scheduler/ConservativeBackfill.java trunk/source/gridsim/parallel/scheduler/PrioritySelector.java trunk/source/gridsim/parallel/scheduler/RuntimePredicate.java trunk/source/gridsim/parallel/scheduler/SelectiveBackfill.java trunk/source/gridsim/parallel/util/ trunk/source/gridsim/parallel/util/Workload.java trunk/source/gridsim/parallel/util/WorkloadFileReader.java trunk/source/gridsim/parallel/util/WorkloadJob.java trunk/source/gridsim/parallel/util/WorkloadLublin99.java trunk/source/gridsim/parallel/util/WorkloadModel.java Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-05-19 11:41:03 UTC (rev 264) +++ trunk/build.xml 2009-05-19 12:18:14 UTC (rev 265) @@ -26,8 +26,8 @@ </description> <!-- GridSim version number and release year for javadoc --> - <property name="version" value="4.2 beta"/> - <property name="year" value="2008"/> + <property name="version" value="5.0 beta"/> + <property name="year" value="2009"/> <!-- location to store Java classes --> <property name="class.dir" location="./classes" /> @@ -45,7 +45,6 @@ <property name="classpath" location="${jar.dir}/simjava2.jar" /> - <target name="prepare"> <mkdir dir="${class.dir}" /> </target> @@ -62,9 +61,9 @@ * The new jar file only contains gridsim classes NOT SimJava2. --> <target name="makejar" depends="build"> - <echo>Compiling a new jar file, named: "new_gridsim.jar".</echo> + <echo>Compiling a new jar file, named: "gridsim.jar".</echo> <echo>This jar file only contains GridSim classes but not SimJava2.</echo> - <jar destfile="${jar.dir}/new_gridsim.jar" basedir="${class.dir}" /> + <jar destfile="${jar.dir}/gridsim.jar" basedir="${class.dir}" /> </target> <target name="clean" description="clean up" > Modified: trunk/changelog.txt =================================================================== --- trunk/changelog.txt 2009-05-19 11:41:03 UTC (rev 264) +++ trunk/changelog.txt 2009-05-19 12:18:14 UTC (rev 265) @@ -1,7 +1,17 @@ # Changelog for GridSim Toolkit -# Maintained by Anthony Sulistio -# $Id: changelog.txt,v 1.7 2007/09/01 02:40:12 anthony Exp $ +Changes from 4.2 to 5.0 +- Improvements to make GridSim more compatible with Java 5 and 6 +- Changes in SimJava to enable a simulation to be paused and resumed. +- Add a new package (i.e. gridsim.parallel) that provides: + * A graphical user interface for debugging resource allocation policies + * several allocation policies for scheduling parallel jobs on clusters and + and supercomputers. The policies include aggressive backfilling, conservative + backfilling, advance reservation with conservative backfilling, selective + backfilling and agressive backfilling with multiple resource partitions. + * A workload model by Lublin and Feitelson for generating jobs for grid resources. + * A data structure to facilitate the scheduling of jobs and advance reservations. + * Logging features using Java logging API. Changes from 4.0 to 4.1 - add a new functionality that supports resource failures during runtime. Added: trunk/examples/ResFailure/example01/Ex01_Regional_GIS =================================================================== --- trunk/examples/ResFailure/example01/Ex01_Regional_GIS (rev 0) +++ trunk/examples/ResFailure/example01/Ex01_Regional_GIS 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1,4 @@ +Event ResourceID Clock +Registering 10 10.020000998399999 +Registering 15 10.030000998399998 +Registering 20 10.040000998399998 Added: trunk/examples/ResFailure/example01/Ex01_Res_0 =================================================================== --- trunk/examples/ResFailure/example01/Ex01_Res_0 (rev 0) +++ trunk/examples/ResFailure/example01/Ex01_Res_0 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1 @@ +Event NumMachines Clock Added: trunk/examples/ResFailure/example01/Ex01_Res_1 =================================================================== --- trunk/examples/ResFailure/example01/Ex01_Res_1 (rev 0) +++ trunk/examples/ResFailure/example01/Ex01_Res_1 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1,2 @@ +Event NumMachines Clock +Failure 3 31.205408168820174 Added: trunk/examples/ResFailure/example01/Ex01_Res_2 =================================================================== --- trunk/examples/ResFailure/example01/Ex01_Res_2 (rev 0) +++ trunk/examples/ResFailure/example01/Ex01_Res_2 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1 @@ +Event NumMachines Clock Added: trunk/examples/ResFailure/example01/Ex01_User0 =================================================================== --- trunk/examples/ResFailure/example01/Ex01_User0 (rev 0) +++ trunk/examples/ResFailure/example01/Ex01_User0 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1,11 @@ +User Event GridletID Resource GridletStatus Clock +Ex01_User0 Sending 0 Ex01_Res_2 Created 374.04012479999994 +Ex01_User0 Sending 1 Ex01_Res_1 Created 374.77037439999924 +Ex01_User0 Sending 2 Ex01_Res_2 Created 375.50062399999854 +Ex01_User0 Sending 3 Ex01_Res_2 Created 376.23087359999784 +Ex01_User0 Sending 4 Ex01_Res_0 Created 376.96112319999713 +Ex01_User0 Receiving 0 Ex01_Res_2 Success 1233.4001439999986 +Ex01_User0 Receiving 1 Ex01_Res_1 Success 1234.130393599998 +Ex01_User0 Receiving 2 Ex01_Res_2 Success 1234.8606431999972 +Ex01_User0 Receiving 3 Ex01_Res_2 Success 1235.5306431999966 +Ex01_User0 Receiving 4 Ex01_Res_0 Success 1236.3211423999958 Added: trunk/examples/ResFailure/example01/Ex01_User0_Fin =================================================================== --- trunk/examples/ResFailure/example01/Ex01_User0_Fin (rev 0) +++ trunk/examples/ResFailure/example01/Ex01_User0_Fin 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1,6 @@ +User GridletID Resource Cost CPU time Latency +Ex01_User0 0 Ex01_Res_2 2574.0 858.0 245555.1188510172 +Ex01_User0 1 Ex01_Res_1 2574.0 858.0 245555.1188510172 +Ex01_User0 2 Ex01_Res_2 2574.0 858.0 245555.1188510172 +Ex01_User0 3 Ex01_Res_2 2571.809251200002 857.2697504000007 245555.1188510172 +Ex01_User0 4 Ex01_Res_0 2574.0 858.0 245555.1188510172 Added: trunk/examples/ResFailure/example01/GridUserFailureEx01.java =================================================================== --- trunk/examples/ResFailure/example01/GridUserFailureEx01.java (rev 0) +++ trunk/examples/ResFailure/example01/GridUserFailureEx01.java 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1,747 @@ +package ResFailure.example01; + +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * An example of how to use the failure functionality. + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Author: Agustin Caminero and Anthony Sulistio + * Organization: UCLM (Spain) + * Created on: August 2007 + */ + +import gridsim.*; +import gridsim.index.AbstractGIS; +import gridsim.net.Link; +import java.util.Random; +import java.util.ArrayList; +import java.io.FileWriter; +import gridsim.resFailure.RegionalGISWithFailure; +import eduni.simjava.Sim_system; +import eduni.simjava.Sim_event; + + +/** + * Creates a Grid User that also considers what happens if a resource fails. + * @author Agustin Caminero and Anthony Sulistio + * @since GridSim Toolkit 4.1 + */ +public class GridUserFailureEx01 extends GridUser +{ + // the base for our constants (chosen at random) + private static final int BASE = 440000; + + /** This constant is to tell the user when he should submit a gridlet */ + private static final int SUBMIT_GRIDLET = BASE + 1; + + private ArrayList GridletSubmittedList_; // list of submitted Gridlets + private GridletList GridletReceiveList_; // list of received Gridlets + + private int NUM_GRIDLETS; + private double pollingTime_; + + // The sizes of gridlets + private int gridletLength; + private int gridletInput; + private int gridletOutput; + + // we keep here the time when each gridlet is submitted + private double gridletSubmissionTime []; + private double gridletLatencyTime []; + + // a flag that denotes whether to trace GridSim events or not. + private boolean trace_flag; + + + /** + * Creates a GridUserFailure object + * @param name this entity name + * @param link a network link connecting this entity + * @param pollTime the time between polls + * @param glLength length (MI) for the gridlets of this user + * @param glIn input file size for the gridlets of this user + * @param glOut output file size for the gridlets of this user + * @param trace_flag a flag that denotes whether to trace this user events + * or not. + * @throws java.lang.Exception happens if either name or link is empty + */ + public GridUserFailureEx01(String name, Link link, double pollTime, + int glLength, int glIn, int glOut, boolean trace_flag) + throws Exception + { + super(name, link); + + this.GridletSubmittedList_ = new ArrayList(); + this.GridletReceiveList_ = new GridletList(); + pollingTime_ = pollTime; + + gridletLength = glLength; + gridletInput = glIn; + gridletOutput = glOut; + this.trace_flag = trace_flag; + } + + /** + * Sets the number of gridlets that this user has to submit. + * Also, create the submission and reception times arrays. + * @param gridlet_num the number of gridlets + */ + public void setGridletNumber(int gridlet_num) + { + NUM_GRIDLETS = gridlet_num; + + gridletSubmissionTime = new double[NUM_GRIDLETS]; + gridletLatencyTime = new double[NUM_GRIDLETS]; + } + + /** + * Handles incoming requests to this entity. + * This method specifies the behaviours and/or scenarios of a user. + */ + public void body() + { + initializeResultsFile(); + createGridlet(super.get_id(), NUM_GRIDLETS); + + // schedule the initial sending of gridlets. + // The sending will start in a ramdom time within 5 min + Random random = new Random(); + int init_time = random.nextInt(5*60); + + // sends a reminder to itself + super.send(super.get_id(), init_time, SUBMIT_GRIDLET); + System.out.println(super.get_name() + + ": initial SUBMIT_GRIDLET event will be at clock: " + + init_time + ". Current clock: " + GridSim.clock()); + + + //////////////////////////////////////////////////////////// + // Now, we have the framework of the entity: + while (Sim_system.running()) + { + Sim_event ev = new Sim_event(); + super.sim_get_next(ev); // get the next event in the queue + + switch (ev.get_tag()) + { + // submit a gridlet + case SUBMIT_GRIDLET: + processGridletSubmission(ev); // process the received event + break; + + // Receive a gridlet back + case GridSimTags.GRIDLET_RETURN: + processGridletReturn(ev); + break; + + case GridSimTags.END_OF_SIMULATION: + System.out.println("\n============== " + super.get_name() + + ". Ending simulation..."); + break; + + default: + System.out.println(super.get_name() + + ": Received an event: " + ev.get_tag()); + break; + + } // switch + + } // while + + // remove I/O entities created during construction of this entity + super.terminateIOEntities(); + + // prints the completed gridlets + printGridletList(GridletReceiveList_, super.get_name(), false, + gridletLatencyTime); + } // body() + + ///////////////////////////////////////////////////////////////////////// + + /** + * This functions process the submission of a gridlet. We have to get the + * list of available resources from the RegGIS, choose one of them, and + * submit the gridlet. + * @param ev an incoming event + */ + private void processGridletSubmission(Sim_event ev) + { + if (trace_flag) + { + System.out.println(super.get_name() + + ": received an SUBMIT_GRIDLET event. Clock: " + GridSim.clock()); + } + + /*********** + We have to submit: + - the gridlet whose id comes with the event + - all the gridlets with the "gridletSub.getSubmitted() == false" + + So, set the gridletSub.getSubmitted() to false for the gridlet whose + id comes with the event + ***********/ + + int i = 0; + GridletSubmission gridletSub; + int resourceID[]; + Random random = new Random(5); // a random generator with a random seed + int index; + Gridlet gl; + Integer obj; + int glID; + + // This is because the initial GRIDLET_SUBMIT event, at the beginning + // of sims, does not have any gridlet id. We have to submit + // all the gridlets. + if (ev.get_data() instanceof Integer) + { + obj = (Integer) ev.get_data(); + glID = obj.intValue(); // get the gridlet id. + } + else { + glID = 99; // a value at random, not used at all in this case + } + + while (i < GridletSubmittedList_.size()) + { + gridletSub = (GridletSubmission)GridletSubmittedList_.get(i); + + if ( (gridletSub.getGridlet()).getGridletID() == glID ) + { + // set this gridlet whose id comes with the event as not submitted, + // so that it is submitted as soon as possible. + ((GridletSubmission) GridletSubmittedList_.get(i)).setSubmitted(false); + } + + // Submit the gridlets with the "gridletSub.getSubmitted() == false" + if ( (gridletSub.getSubmitted() == false)) + { + // we have to resubmit this gridlet + gl = ((GridletSubmission) GridletSubmittedList_.get(i)).getGridlet(); + resourceID = getResList(); // Get list of resources from GIS + + // If we have resources in the list + if ((resourceID != null) && (resourceID.length != 0)) + { + index = random.nextInt(resourceID.length); + + // make sure the gridlet will be executed from the begining + resetGridlet(gl); + + // submits this gridlet to a resource + super.gridletSubmit(gl, resourceID[index]); + gridletSubmissionTime[gl.getGridletID()] = GridSim.clock(); + + // set this gridlet as submitted + ((GridletSubmission) GridletSubmittedList_.get(i)).setSubmitted(true); + + if (trace_flag) + { + System.out.println(super.get_name() + + ": Sending Gridlet #" + i + " to " + + GridSim.getEntityName(resourceID[index]) + + " at clock: " + GridSim.clock()); + + // Write into a results file + write(super.get_name(), "Sending", gl.getGridletID(), + GridSim.getEntityName(resourceID[index]), + gl.getGridletStatusString(), GridSim.clock()); + } + + } + // No resources available at this moment, so schedule an event + // in the future. The event wil be in 15 min (900 sec), as + // resource failures may last several hours. + // This event includes the gridletID, so that the user will + // try to submit only this gridlet + else + { + super.send(super.get_id(), GridSimTags.SCHEDULE_NOW + 900, + SUBMIT_GRIDLET, new Integer(gl.getGridletID()) ); + } + + }// if (gridletSub.getSubmitted() == false) + + i++; + } // while (i < GridletSubmittedList_.size()) + + } // processGridletSubmission + + /** + * This functions process the return of a gridlet. + * We pay attention to the status of the gridlet + * and then decide what we have to do the next + * @param ev an incoming event + */ + private void processGridletReturn(Sim_event ev) + { + if (trace_flag) + { + System.out.println(super.get_name() + + ": received an GRIDLET_RETURN event. Clock: " + GridSim.clock()); + } + + Object obj = (Object) ev.get_data(); + Gridlet gl = null; + Random random = new Random(5); // a random generator with a random seed + + if (obj instanceof Gridlet) + { + gl = (Gridlet) obj; + gridletLatencyTime[gl.getGridletID()] = GridSim.clock(); + + // Write into a results file + if (trace_flag) + { + write(super.get_name(), "Receiving", gl.getGridletID(), + GridSim.getEntityName(gl.getResourceID()), + gl.getGridletStatusString(), GridSim.clock()); + } + + ///////////////////////// Gridlet Success + if (gl.getGridletStatusString().compareTo("Success") == 0) + { + System.out.println(super.get_name() + ": Receiving Gridlet #" + + gl.getGridletID() + " with status Success at time = " + + GridSim.clock() + " from resource " + + GridSim.getEntityName(gl.getResourceID())); + + this.GridletReceiveList_.add(gl); // add into the received list + gridletLatencyTime[gl.getGridletID()] = + gridletLatencyTime[gl.getGridletID()] - + gridletSubmissionTime[gl.getGridletID()]; + + // We have received all the gridlets. So, finish the simulation. + if (GridletReceiveList_.size() == GridletSubmittedList_.size()) + { + super.finishSimulation(); + } + + } // if (gl.getGridletStatusString() == "Success") + + //////////////////////// Gridlet Failed + else if (gl.getGridletStatusString().compareTo("Failed") == 0) + { + System.out.println(super.get_name() + ": Receiving Gridlet #" + + gl.getGridletID() + " with status Failed at time = " + + GridSim.clock() + " from resource " + + GridSim.getEntityName(gl.getResourceID())); + + // Send the gridlet as soon as we have resources available. + // This gridlet will be resend as soon as possible, + // in the first loop. + int pos = findGridletInGridletSubmittedList(gl); + if (pos == -1) { + System.out.println(super.get_name() + + ". Gridlet not found in GridletSubmittedList."); + } + else + { + // set this gridlet as submitted, because otherwise + // this gridlet may be submitted several times. + // A gridlet will only be submitted when the event carrying + // its id reaches the user + ((GridletSubmission) GridletSubmittedList_.get(pos)).setSubmitted(true); + + // Now, schedule an event to itself to submit the gridlet + // The gridlet will be sent as soon as possible + Integer glID_Int = new Integer(gl.getGridletID()); + + // This event includes the gridletID, so that the user + // will try to submit only this gridlet + super.send(super.get_id(), GridSimTags.SCHEDULE_NOW, + SUBMIT_GRIDLET, glID_Int); + } + } // if (gl.getGridletStatusString() == "Failed") + + ////////////////////////////// Gridlet Failed_resource + else if (gl.getGridletStatusString().compareTo("Failed_resource_unavailable") == 0) + { + int pos = findGridletInGridletSubmittedList(gl); + if (pos == -1) { + System.out.println(super.get_name() + + ". Gridlet not found in GridletSubmittedList."); + } + else + { + // Now, set its submission time for a random time between + // 1 and the polling time + double resubmissionTime = random.nextDouble() * pollingTime_; + + // this is to prevent the gridlet from being submitted + // before its resubmission time. + // This is different from the FAILED case, because + // in that case, the gridlet should be resubmited as soon + // as possible. As oppossed to that, this gridlet should + // not be resubmited before its resubmission time. + ((GridletSubmission) GridletSubmittedList_.get(pos)).setSubmitted(true); + + + System.out.println(super.get_name() + ": Receiving Gridlet #" + + gl.getGridletID() + + " with status Failed_resource_unavailable at time = " + + GridSim.clock() + " from resource " + + GridSim.getEntityName(gl.getResourceID()) + + "(resID: " + gl.getResourceID() + + "). Resubmission time will be: " + + resubmissionTime + GridSim.clock()); + + // Now, we have to inform the GIS about this failure, so it + // can keep the list of resources up-to-date. + informGIS(gl.getResourceID()); + + // Now, schedule an event to itself to submit the gridlet + Integer glID_Int = new Integer(gl.getGridletID()); + + // This event includes the gridletID, so that the user + // will try to submit only this gridlet + super.send(super.get_id(), resubmissionTime, + SUBMIT_GRIDLET, glID_Int); + } + } // else if + else + { + System.out.println(super.get_name() + ": Receiving Gridlet #" + + gl.getGridletID() + " with status " + + gl.getGridletStatusString() + " at time = " + + GridSim.clock() + " from resource " + + GridSim.getEntityName(gl.getResourceID()) + + " resID: " + gl.getResourceID()); + } + + } // if (obj instanceof Gridlet) + } + + /** + * Prints the Gridlet objects + * @param list the list of gridlets + * @param name the name of the user + * @param detail if we want the gridlet's history or not + * @param gridletLatencyTime array containing the latencies of gridlets. + * Latencies are from the moment when the gridlet is sent, till + * the moment they are back at the user. + * They take into account the last submission of a gridlet + * (when the gridlet is successfully run) + */ + private void printGridletList(GridletList list, String name, + boolean detail, double gridletLatencyTime[]) + { + int size = list.size(); + Gridlet gridlet = null; + + String indent = " "; + System.out.println(); + System.out.println("============= OUTPUT for " + name + " =========="); + System.out.println("Gridlet ID" + indent + "STATUS" + indent + + "Resource ID" + indent + "Cost" + indent + + "CPU Time"+ indent + "Latency"); + + // a loop to print the overall result + int i = 0; + for (i = 0; i < size; i++) + { + gridlet = (Gridlet) list.get(i); + System.out.print(indent + gridlet.getGridletID() + indent + + indent); + + System.out.print(gridlet.getGridletStatusString()); + + System.out.println(indent + indent + gridlet.getResourceID() + + indent + indent + gridlet.getProcessingCost() + + indent + indent + gridlet.getActualCPUTime()+ + indent + indent + + gridletLatencyTime[gridlet.getGridletID()]); + + writeFin(name, gridlet.getGridletID(), + GridSim.getEntityName(gridlet.getResourceID()), + gridlet.getProcessingCost(), gridlet.getActualCPUTime(), + GridSim.clock()); + + + + } + + + if (detail == true) + { + // a loop to print each Gridlet's history + for (i = 0; i < size; i++) + { + gridlet = (Gridlet) list.get(i); + System.out.println(gridlet.getGridletHistory()); + + System.out.print("Gridlet #" + gridlet.getGridletID()); + System.out.println(", length = " + gridlet.getGridletLength() + + ", finished so far = " + + gridlet.getGridletFinishedSoFar()); + System.out.println("======================================\n"); + } + } + + System.out.println("================================================="); + + } + + /** + * This method will show you on how to create Gridlets + * @param userID owner ID of a Gridlet + * @param numGridlet number of Gridlet to be created + */ + private void createGridlet(int userID, int numGridlet) + { + for (int i = 0; i < numGridlet; i++) + { + // Creates a Gridlet + Gridlet gl = new Gridlet(i, gridletLength, gridletInput, gridletOutput); + gl.setUserID(userID); + + // Originally, gridlets are created to be submitted + // as soon as possible (the 0.0 param) + GridletSubmission gst = new GridletSubmission(gl, false); + + // add this gridlet into a list + this.GridletSubmittedList_.add(gst); + } + } + + /** + * Gets a list of received Gridlets + * @return a list of received/completed Gridlets + */ + public GridletList getGridletList() { + return GridletReceiveList_; + } + + /** + * Tells you the possition of this gridlet in the GridletSubmittedList_ + * @param gl the gridlet + * @return the position of this gridlet in the list of submitted gridlets + */ + private int findGridletInGridletSubmittedList(Gridlet gl) + { + Gridlet g = null; + GridletSubmission gst = null; + for (int i = 0; i< GridletSubmittedList_.size(); i++) + { + gst = (GridletSubmission)GridletSubmittedList_.get(i); + g = gst.getGridlet(); + + if ( g.getGridletID() == gl.getGridletID() ) + return i; + } + + return -1; + } + + /** This function resets the gridlet into its original values of + * length and gridletFinishedSoFar + * @param gl the gridlet to be resetted + */ + private void resetGridlet (Gridlet gl) + { + gl.setGridletLength(gridletLength); + gl.setGridletFinishedSoFar(0); + + } + + /** + * Write some data into the final results file. + * @param user user name + * @param glID gridlet id + * @param resName Name of the resource + * @param cost the processing cost of the gridlet + * @param cpu the cpu time + * @param clock Current time + */ + private void writeFin(String user, int glID, String resName, + double cost, double cpu, double clock) + { + if (trace_flag == false) { + return; + } + + // Write into a results file + FileWriter fwriter = null; + try + { + fwriter = new FileWriter(user+"_Fin", true); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while opening file " + user+"_Fin"); + } + + try + { + fwriter.write(user +"\t "+ glID + "\t" + + resName + "\t" + cost + "\t"+ cpu + "\t" + + clock + "\n"); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while writing on file " + user+"_Fin"); + } + + try + { + fwriter.close(); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while closing file " + user+"_Fin"); + } + + } + + /** + * Write some data into a results file. + * @param user user name + * @param event Values: "Sending" or "Receive" a gridlet + * @param glID gridlet id + * @param resName Name of the resource + * @param status Status of the gridlet + * @param clock Current time + * */ + private void write(String user, String event, int glID, String resName, + String status, double clock) + { + if (trace_flag == false) { + return; + } + + // Write into a results file + FileWriter fwriter = null; + try + { + fwriter = new FileWriter(super.get_name(), true); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while opening file " + super.get_name()); + } + + try + { + fwriter.write(user + "\t " + event + "\t" + glID + "\t" + + resName + "\t" + status + "\t\t" + clock + "\t" + "\n"); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while writing on file " + super.get_name()); + } + + + try + { + fwriter.close(); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while closing file " + super.get_name()); + } + + } + + /** + * This function informs the GIS of this user about the failure of a resource + * @param resID the id of the resource which has failed + */ + private void informGIS(int resID) + { + Integer resID_Int = new Integer(resID); + + super.send(super.output, 0.0, AbstractGIS.NOTIFY_GIS_RESOURCE_FAILURE, + new IO_data(resID_Int, Link.DEFAULT_MTU, super.getRegionalGISId()) ); + } + + /** + * Initialize the results files (put headers over each column) + * */ + private void initializeResultsFile() + { + if (trace_flag == false) { + return; + } + + // Initialize the results file + FileWriter fwriter = null; + FileWriter fwriterFin = null; + try + { + fwriter = new FileWriter(super.get_name(), true); + fwriterFin = new FileWriter(super.get_name() + "_Fin", true); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while opening file " + super.get_name() + + " or " + super.get_name()+"_Fin"); + } + + try + { + fwriter.write( + "User \t\t Event \t GridletID \t Resource \t GridletStatus \t\t\t Clock\n"); + fwriterFin.write( + "User \t\t GridletID \t Resource \t Cost \t CPU time \t Latency\n"); + + + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while writing on file " + super.get_name()+ + " or " + super.get_name()+"_Fin"); + } + + try + { + fwriter.close(); + fwriterFin.close(); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while closing file " + super.get_name()+ + " or " + super.get_name()+"_Fin"); + } + } + + /** + * This function retrieves a list of available resources from the GIS. + * @return an array containing the ids of the resources + */ + private int[] getResList() + { + Object[] resList = super.getLocalResourceList(); + int resourceID[] = null; + + // if we have any resource + if ((resList != null) && (resList.length != 0)) + { + resourceID = new int[resList.length]; + for (int x = 0; x < resList.length; x++) + { + // Resource list contains list of resource IDs + resourceID[x] = ((Integer) resList[x]).intValue(); + + if (trace_flag == true) + { + System.out.println(super.get_name() + + ": resource[" + x + "] = " + resourceID[x]); + } + } + + } + + return resourceID; + } + +} // end class Added: trunk/examples/ResFailure/example01/GridletSubmission.java =================================================================== --- trunk/examples/ResFailure/example01/GridletSubmission.java (rev 0) +++ trunk/examples/ResFailure/example01/GridletSubmission.java 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1,56 @@ +package ResFailure.example01; + +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * An example of how to use the failure functionality. + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Author: Agustin Caminero and Anthony Sulistio + * Organization: UCLM (Spain) + * Created on: August 2007 + */ + + +import gridsim.Gridlet; + +/** + * This class is just a wrapper to denote + * whether this gridlet has been already submitted or not + * @author Agustin Caminero and Anthony Sulistio + * @since GridSim Toolkit 4.1 + */ +public class GridletSubmission +{ + private Gridlet gl; + private boolean submitted; + + + public GridletSubmission(Gridlet gl,boolean submitted) + { + this.gl = gl; + this.submitted = submitted; + } + + public Gridlet getGridlet() + { + return gl; + } + + public boolean getSubmitted() + { + return submitted; + } + + public void setGridlet(Gridlet g) + { + this.gl = g; + } + + public void setSubmitted(boolean submitted) + { + this.submitted = submitted; + } + +} // end class Added: trunk/examples/ResFailure/example01/ResFailureEx01.java =================================================================== --- trunk/examples/ResFailure/example01/ResFailureEx01.java (rev 0) +++ trunk/examples/ResFailure/example01/ResFailureEx01.java 2009-05-19 12:18:14 UTC (rev 265) @@ -0,0 +1,328 @@ +package ResFailure.example01; + +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * An example of how to use the failure functionality. + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Author: Agustin Caminero and Anthony Sulistio + * Organization: UCLM (Spain) + * Created on: August 2007 + */ + +import gridsim.resFailure.*; +import gridsim.*; +import gridsim.net.*; +import java.util.*; +import gridsim.util.NetworkReader; +import gridsim.util.HyperExponential; + + +/** + * This example shows a basic topology with 1 user, 3 resources and 1 GIS. + * All of them are connected by a router. + * There is only one VO in this example. + * @author Agustin Caminero and Anthony Sulistio + * @since GridSim Toolkit 4.1 + */ +public class ResFailureEx01 +{ + public static void main(String[] args) + { + System.out.println("Starting failure example 1..."); + + try + { + if (args.length < 1) + { + System.out.println("Usage: java ResFailureEx01 network_ex01.txt"); + return; + } + + + ////////////////////////////////////////// + // First step: Initialize the GridSim package. It should be called + // before creating any entities. We can't run this example without + // initializing GridSim first. We will get a run-time exception + // error. + + // a flag that denotes whether to trace GridSim events or not. + boolean trace_flag = false; // dont use SimJava trace + int num_user = 1; // number of grid users + Calendar calendar = Calendar.getInstance(); + + // Initialize the GridSim package + System.out.println("Initializing GridSim package"); + GridSim.init(num_user, calendar, trace_flag); + trace_flag = true; + + + ////////////////////////////////////////// + // Second step: Builds the network topology among Routers. + + String filename = args[0]; // get the network topology + System.out.println("Reading network from " + filename); + LinkedList routerList = NetworkReader.createFIFO(filename); +... [truncated message content] |