You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(24) |
Sep
(14) |
Oct
(13) |
Nov
(5) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(2) |
Feb
(53) |
Mar
(29) |
Apr
(5) |
May
(11) |
Jun
(3) |
Jul
(7) |
Aug
(48) |
Sep
(10) |
Oct
(8) |
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(2) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <bro...@us...> - 2008-08-19 00:39:57
|
Revision: 203 http://gridsim.svn.sourceforge.net/gridsim/?rev=203&view=rev Author: brobergj Date: 2008-08-19 00:40:05 +0000 (Tue, 19 Aug 2008) Log Message: ----------- Adding missing examples. Modified Paths: -------------- branches/gridsim4.0-branch2/examples/FlowNetEx02/FlowNetEx02.java branches/gridsim4.0-branch2/examples/FlowNetEx02/User_0.csv branches/gridsim4.0-branch2/examples/FlowNetEx02/User_1.csv branches/gridsim4.0-branch2/examples/FlowNetEx02/router1_report.csv branches/gridsim4.0-branch2/examples/FlowNetEx02/router2_report.csv Added Paths: ----------- branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetEx01/ branches/gridsim4.0-branch2/examples/FlowNetEx01/buildNrun branches/gridsim4.0-branch2/examples/FlowNetEx01/test1.csv branches/gridsim4.0-branch2/examples/FlowNetEx01/test2.csv branches/gridsim4.0-branch2/examples/FlowNetEx03/ branches/gridsim4.0-branch2/examples/FlowNetEx03/DataGridSim.java branches/gridsim4.0-branch2/examples/FlowNetEx03/FilesReader.java branches/gridsim4.0-branch2/examples/FlowNetEx03/ParameterReader.java branches/gridsim4.0-branch2/examples/FlowNetEx03/README.txt branches/gridsim4.0-branch2/examples/FlowNetEx03/ResourceReader.java branches/gridsim4.0-branch2/examples/FlowNetEx03/SimUser.java branches/gridsim4.0-branch2/examples/FlowNetEx03/UserReader.java branches/gridsim4.0-branch2/examples/FlowNetEx03/files.txt branches/gridsim4.0-branch2/examples/FlowNetEx03/network.txt branches/gridsim4.0-branch2/examples/FlowNetEx03/output.txt branches/gridsim4.0-branch2/examples/FlowNetEx03/parameters.txt branches/gridsim4.0-branch2/examples/FlowNetEx03/resources.txt branches/gridsim4.0-branch2/examples/FlowNetEx03/users.txt Added: branches/gridsim4.0-branch2/examples/FlowNetEx01/buildNrun =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx01/buildNrun (rev 0) +++ branches/gridsim4.0-branch2/examples/FlowNetEx01/buildNrun 2008-08-19 00:40:05 UTC (rev 203) @@ -0,0 +1,6 @@ +echo "Cleaning" +rm -rf FlowNetEx01/ +echo "Building" +javac -classpath /Users/brobergj/workspace/gridsim4.0-branch2/jars/new_gridsim.jar:/Users/brobergj/workspace/gridsim4.0-branch2/jars/simjava2.jar:. -d ./ *.java +echo "Timed Run" +time java -classpath /Users/brobergj/workspace/gridsim4.0-branch2/jars/new_gridsim.jar:/Users/brobergj/workspace/gridsim4.0-branch2/jars/simjava2.jar:./. FlowNetEx01/FlowNetEx01 Property changes on: branches/gridsim4.0-branch2/examples/FlowNetEx01/buildNrun ___________________________________________________________________ Added: svn:executable + * Added: branches/gridsim4.0-branch2/examples/FlowNetEx01/test1.csv =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx01/test1.csv (rev 0) +++ branches/gridsim4.0-branch2/examples/FlowNetEx01/test1.csv 2008-08-19 00:40:05 UTC (rev 203) @@ -0,0 +1,8 @@ +0.0 Creates test1 +15997.508293660483 test1.body(): receive Message_0, at time = 15997.508293660483 +15997.508293660483 test1.body(): Sending back Message_0, at time = 15997.508293660483 +16004.815793863934 test1.body(): receive Message_1, at time = 16004.815793863934 +16004.815793863934 test1.body(): Sending back Message_1, at time = 16004.815793863934 +16006.797457885745 test1.body(): receive Message_2, at time = 16006.797457885745 +16006.797457885745 test1.body(): Sending back Message_2, at time = 16006.797457885745 +17007.797457885747 test1.body(): exiting ... Added: branches/gridsim4.0-branch2/examples/FlowNetEx01/test2.csv =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx01/test2.csv (rev 0) +++ branches/gridsim4.0-branch2/examples/FlowNetEx01/test2.csv 2008-08-19 00:40:05 UTC (rev 203) @@ -0,0 +1,8 @@ +0.0 Creates test2 +15939.24998779297 test2.body(): receive Message_0, at time = 15939.24998779297 +15939.24998779297 test2.body(): Sending back Message_0, at time = 15939.24998779297 +15987.874992879233 test2.body(): receive Message_1, at time = 15987.874992879233 +15987.874992879233 test2.body(): Sending back Message_1, at time = 15987.874992879233 +16002.370796712241 test2.body(): receive Message_2, at time = 16002.370796712241 +16002.370796712241 test2.body(): Sending back Message_2, at time = 16002.370796712241 +17003.37079671224 test2.body(): exiting ... Modified: branches/gridsim4.0-branch2/examples/FlowNetEx02/FlowNetEx02.java =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx02/FlowNetEx02.java 2008-08-19 00:35:48 UTC (rev 202) +++ branches/gridsim4.0-branch2/examples/FlowNetEx02/FlowNetEx02.java 2008-08-19 00:40:05 UTC (rev 203) @@ -62,7 +62,7 @@ // more resources can be created by // setting totalResource to an appropriate value - int totalResource = 1; + int totalResource = 10; ArrayList resList = new ArrayList(totalResource); for (i = 0; i < totalResource; i++) { @@ -77,7 +77,7 @@ // Third step: Creates one or more grid user entities // number of Gridlets that will be sent to the resource - int totalGridlet = 5; + int totalGridlet = 40; // create users ArrayList userList = new ArrayList(num_user); Modified: branches/gridsim4.0-branch2/examples/FlowNetEx02/User_0.csv =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx02/User_0.csv 2008-08-19 00:35:48 UTC (rev 202) +++ branches/gridsim4.0-branch2/examples/FlowNetEx02/User_0.csv 2008-08-19 00:40:05 UTC (rev 203) @@ -1,32 +1,120 @@ -0.0, Creating a grid user entity with name = User_0, and id = 10 -0.0, User_0:Creating 5 Gridlets -3.0, User_0Sending Gridlet #0 to Res_0 -3.0, User_0Sending Gridlet #1 to Res_0 -205.59299946949602, ack = true for Gridlet #1 -205.59299946949602, User_0Sending Gridlet #2 to Res_0 -205.59299946949602, User_0Sending Gridlet #3 to Res_0 -786.6569994694959, ack = true for Gridlet #3 -786.6569994694959, User_0Sending Gridlet #4 to Res_0 -791.6569994694959, User_0: Receiving Gridlet #0 at time = 791.6569994694959 -791.6569994694959, User_0: Receiving Gridlet #1 at time = 791.6569994694959 -791.6569994694959, User_0: Receiving Gridlet #2 at time = 791.6569994694959 -875.8505994694959, User_0: Receiving Gridlet #3 at time = 875.8505994694959 -2487.722599469497, User_0: Receiving Gridlet #4 at time = 2487.722599469497 -6280.660000000001, +0.0 Creating a grid user entity with name = User_0, and id = 55 +0.0 User_0:Creating 40 Gridlets +3.0 User_0Sending Gridlet #0 to Res_4 +3.0 User_0Sending Gridlet #1 to Res_4 +83.12200000000001 ack = true for Gridlet #1 +83.12200000000001 User_0Sending Gridlet #2 to Res_4 +83.12200000000001 User_0Sending Gridlet #3 to Res_4 +235.552599469496 ack = true for Gridlet #3 +235.552599469496 User_0Sending Gridlet #4 to Res_4 +235.552599469496 User_0Sending Gridlet #5 to Res_4 +396.399198938992 ack = true for Gridlet #5 +396.399198938992 User_0Sending Gridlet #6 to Res_4 +396.399198938992 User_0Sending Gridlet #7 to Res_4 +556.749798408488 ack = true for Gridlet #7 +556.749798408488 User_0Sending Gridlet #8 to Res_4 +556.749798408488 User_0Sending Gridlet #9 to Res_4 +715.972397877984 ack = true for Gridlet #9 +715.972397877984 User_0Sending Gridlet #10 to Res_4 +715.972397877984 User_0Sending Gridlet #11 to Res_4 +876.52299734748 ack = true for Gridlet #11 +876.52299734748 User_0Sending Gridlet #12 to Res_4 +876.52299734748 User_0Sending Gridlet #13 to Res_4 +1036.4415968169758 ack = true for Gridlet #13 +1036.4415968169758 User_0Sending Gridlet #14 to Res_4 +1036.4415968169758 User_0Sending Gridlet #15 to Res_4 +1196.984196286472 ack = true for Gridlet #15 +1196.984196286472 User_0Sending Gridlet #16 to Res_4 +1196.984196286472 User_0Sending Gridlet #17 to Res_4 +1357.1187957559682 ack = true for Gridlet #17 +1357.1187957559682 User_0Sending Gridlet #18 to Res_4 +1357.1187957559682 User_0Sending Gridlet #19 to Res_4 +1517.1013952254643 ack = true for Gridlet #19 +1517.1013952254643 User_0Sending Gridlet #20 to Res_4 +1517.1013952254643 User_0Sending Gridlet #21 to Res_4 +1677.2359946949603 ack = true for Gridlet #21 +1677.2359946949603 User_0Sending Gridlet #22 to Res_4 +1677.2359946949603 User_0Sending Gridlet #23 to Res_4 +1836.9065941644562 ack = true for Gridlet #23 +1836.9065941644562 User_0Sending Gridlet #24 to Res_4 +1836.9065941644562 User_0Sending Gridlet #25 to Res_4 +1997.0891936339524 ack = true for Gridlet #25 +1997.0891936339524 User_0Sending Gridlet #26 to Res_4 +1997.0891936339524 User_0Sending Gridlet #27 to Res_4 +2157.079793103449 ack = true for Gridlet #27 +2157.079793103449 User_0Sending Gridlet #28 to Res_4 +2157.079793103449 User_0Sending Gridlet #29 to Res_4 +2316.566392572945 ack = true for Gridlet #29 +2316.566392572945 User_0Sending Gridlet #30 to Res_4 +2316.566392572945 User_0Sending Gridlet #31 to Res_4 +2477.004992042441 ack = true for Gridlet #31 +2477.004992042441 User_0Sending Gridlet #32 to Res_4 +2477.004992042441 User_0Sending Gridlet #33 to Res_4 +2636.8915915119364 ack = true for Gridlet #33 +2636.8915915119364 User_0Sending Gridlet #34 to Res_4 +2636.8915915119364 User_0Sending Gridlet #35 to Res_4 +2797.146190981432 ack = true for Gridlet #35 +2797.146190981432 User_0Sending Gridlet #36 to Res_4 +2797.146190981432 User_0Sending Gridlet #37 to Res_4 +2969.3047904509276 ack = true for Gridlet #37 +2969.3047904509276 User_0Sending Gridlet #38 to Res_4 +2969.3047904509276 User_0Sending Gridlet #39 to Res_4 +3129.303389920424 ack = true for Gridlet #39 +3134.303389920424 User_0: Receiving Gridlet #0 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #1 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #3 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #2 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #4 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #5 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #7 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #6 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #9 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #8 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #10 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #11 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #12 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #13 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #14 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #15 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #16 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #17 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #18 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #19 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #20 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #21 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #22 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #23 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #24 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #25 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #26 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #27 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #29 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #28 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #31 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #30 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #32 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #33 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #34 at time = 3134.303389920424 +3134.303389920424 User_0: Receiving Gridlet #35 at time = 3134.303389920424 +3136.263389920424 User_0: Receiving Gridlet #36 at time = 3136.263389920424 +3136.263389920424 User_0: Receiving Gridlet #37 at time = 3136.263389920424 +3223.3739893899196 User_0: Receiving Gridlet #38 at time = 3223.3739893899196 +3223.3739893899196 User_0: Receiving Gridlet #39 at time = 3223.3739893899196 +3223.433989389921 -------- User_0 ---------------- -6280.660000000001, Ping information for User_0 +3223.433989389921 Ping information for User_0 Entity Name Entry Time Exit Time Bandwidth ---------------------------------------------------------- -User_0 2487.7226 3995.000 1000.000 -router1 3995.010 3997.410 10000.000 -router2 3997.420 6272.220 1000.000 -Res_0 6272.230 6276.230 1000.000 -router2 6276.240 6276.640 10000.000 -router1 6276.650 6280.650 1000.000 -User_0 6280.660 N/A N/A +User_0 3223.374 3223.374 1000.000 +router1 3223.384 3223.384 10000.000 +router2 3223.394 3223.394 1000.000 +Res_4 3223.404 3223.404 1000.000 +router2 3223.414 3223.414 10000.000 +router1 3223.424 3223.424 1000.000 +User_0 3223.434 N/A N/A -Round Trip Time : 2285.660 seconds +Round Trip Time : 0.060 seconds Number of Hops : 3 Bottleneck Bandwidth : 1000.0 bits/s -6280.660000000001, -------- User_0 ---------------- +3223.433989389921 -------- User_0 ---------------- Modified: branches/gridsim4.0-branch2/examples/FlowNetEx02/User_1.csv =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx02/User_1.csv 2008-08-19 00:35:48 UTC (rev 202) +++ branches/gridsim4.0-branch2/examples/FlowNetEx02/User_1.csv 2008-08-19 00:40:05 UTC (rev 203) @@ -1,32 +1,120 @@ -0.0, Creating a grid user entity with name = User_1, and id = 14 -0.0, User_1:Creating 5 Gridlets -3.0, User_1Sending Gridlet #0 to Res_0 -3.0, User_1Sending Gridlet #1 to Res_0 -219.01999999999998, ack = true for Gridlet #1 -219.01999999999998, User_1Sending Gridlet #2 to Res_0 -219.01999999999998, User_1Sending Gridlet #3 to Res_0 -835.722599469496, ack = true for Gridlet #3 -835.722599469496, User_1Sending Gridlet #4 to Res_0 -840.722599469496, User_1: Receiving Gridlet #0 at time = 840.722599469496 -840.722599469496, User_1: Receiving Gridlet #1 at time = 840.722599469496 -840.722599469496, User_1: Receiving Gridlet #2 at time = 840.722599469496 -883.786599469496, User_1: Receiving Gridlet #3 at time = 883.786599469496 -2543.0200000000004, User_1: Receiving Gridlet #4 at time = 2543.0200000000004 -6680.660000000001, +0.0 Creating a grid user entity with name = User_1, and id = 59 +0.0 User_1:Creating 40 Gridlets +3.0 User_1Sending Gridlet #0 to Res_7 +3.0 User_1Sending Gridlet #1 to Res_7 +87.12200000000001 ack = true for Gridlet #1 +87.12200000000001 User_1Sending Gridlet #2 to Res_7 +87.12200000000001 User_1Sending Gridlet #3 to Res_7 +239.552599469496 ack = true for Gridlet #3 +239.552599469496 User_1Sending Gridlet #4 to Res_7 +239.552599469496 User_1Sending Gridlet #5 to Res_7 +400.399198938992 ack = true for Gridlet #5 +400.399198938992 User_1Sending Gridlet #6 to Res_7 +400.399198938992 User_1Sending Gridlet #7 to Res_7 +560.749798408488 ack = true for Gridlet #7 +560.749798408488 User_1Sending Gridlet #8 to Res_7 +560.749798408488 User_1Sending Gridlet #9 to Res_7 +719.972397877984 ack = true for Gridlet #9 +719.972397877984 User_1Sending Gridlet #10 to Res_7 +719.972397877984 User_1Sending Gridlet #11 to Res_7 +880.52299734748 ack = true for Gridlet #11 +880.52299734748 User_1Sending Gridlet #12 to Res_7 +880.52299734748 User_1Sending Gridlet #13 to Res_7 +1040.4415968169758 ack = true for Gridlet #13 +1040.4415968169758 User_1Sending Gridlet #14 to Res_7 +1040.4415968169758 User_1Sending Gridlet #15 to Res_7 +1200.984196286472 ack = true for Gridlet #15 +1200.984196286472 User_1Sending Gridlet #16 to Res_7 +1200.984196286472 User_1Sending Gridlet #17 to Res_7 +1361.1187957559682 ack = true for Gridlet #17 +1361.1187957559682 User_1Sending Gridlet #18 to Res_7 +1361.1187957559682 User_1Sending Gridlet #19 to Res_7 +1521.1013952254643 ack = true for Gridlet #19 +1521.1013952254643 User_1Sending Gridlet #20 to Res_7 +1521.1013952254643 User_1Sending Gridlet #21 to Res_7 +1681.2359946949603 ack = true for Gridlet #21 +1681.2359946949603 User_1Sending Gridlet #22 to Res_7 +1681.2359946949603 User_1Sending Gridlet #23 to Res_7 +1840.9065941644562 ack = true for Gridlet #23 +1840.9065941644562 User_1Sending Gridlet #24 to Res_7 +1840.9065941644562 User_1Sending Gridlet #25 to Res_7 +2001.0891936339524 ack = true for Gridlet #25 +2001.0891936339524 User_1Sending Gridlet #26 to Res_7 +2001.0891936339524 User_1Sending Gridlet #27 to Res_7 +2161.079793103449 ack = true for Gridlet #27 +2161.079793103449 User_1Sending Gridlet #28 to Res_7 +2161.079793103449 User_1Sending Gridlet #29 to Res_7 +2320.566392572945 ack = true for Gridlet #29 +2320.566392572945 User_1Sending Gridlet #30 to Res_7 +2320.566392572945 User_1Sending Gridlet #31 to Res_7 +2481.004992042441 ack = true for Gridlet #31 +2481.004992042441 User_1Sending Gridlet #32 to Res_7 +2481.004992042441 User_1Sending Gridlet #33 to Res_7 +2640.8915915119364 ack = true for Gridlet #33 +2640.8915915119364 User_1Sending Gridlet #34 to Res_7 +2640.8915915119364 User_1Sending Gridlet #35 to Res_7 +2801.146190981432 ack = true for Gridlet #35 +2801.146190981432 User_1Sending Gridlet #36 to Res_7 +2801.146190981432 User_1Sending Gridlet #37 to Res_7 +2973.3047904509276 ack = true for Gridlet #37 +2973.3047904509276 User_1Sending Gridlet #38 to Res_7 +2973.3047904509276 User_1Sending Gridlet #39 to Res_7 +3133.303389920424 ack = true for Gridlet #39 +3138.303389920424 User_1: Receiving Gridlet #0 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #1 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #3 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #2 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #4 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #5 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #7 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #6 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #8 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #9 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #11 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #10 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #12 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #13 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #14 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #15 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #16 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #17 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #18 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #19 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #20 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #21 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #22 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #23 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #24 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #25 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #26 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #27 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #29 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #28 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #30 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #31 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #32 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #33 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #34 at time = 3138.303389920424 +3138.303389920424 User_1: Receiving Gridlet #35 at time = 3138.303389920424 +3140.263389920424 User_1: Receiving Gridlet #36 at time = 3140.263389920424 +3140.263389920424 User_1: Receiving Gridlet #37 at time = 3140.263389920424 +3227.3739893899196 User_1: Receiving Gridlet #38 at time = 3227.3739893899196 +3227.3739893899196 User_1: Receiving Gridlet #39 at time = 3227.3739893899196 +3227.433989389921 -------- User_1 ---------------- -6680.660000000001, Ping information for User_1 +3227.433989389921 Ping information for User_1 Entity Name Entry Time Exit Time Bandwidth ---------------------------------------------------------- -User_1 2543.020 4283.000 1000.000 -router1 4283.010 4283.410 10000.000 -router2 4283.420 6672.220 1000.000 -Res_0 6672.230 6676.230 1000.000 -router2 6676.240 6676.640 10000.000 -router1 6676.650 6680.650 1000.000 -User_1 6680.660 N/A N/A +User_1 3227.374 3227.374 1000.000 +router1 3227.384 3227.384 10000.000 +router2 3227.394 3227.394 1000.000 +Res_7 3227.404 3227.404 1000.000 +router2 3227.414 3227.414 10000.000 +router1 3227.424 3227.424 1000.000 +User_1 3227.434 N/A N/A -Round Trip Time : 2397.660 seconds +Round Trip Time : 0.060 seconds Number of Hops : 3 Bottleneck Bandwidth : 1000.0 bits/s -6680.660000000001, -------- User_1 ---------------- +3227.433989389921 -------- User_1 ---------------- Modified: branches/gridsim4.0-branch2/examples/FlowNetEx02/router1_report.csv =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx02/router1_report.csv 2008-08-19 00:35:48 UTC (rev 202) +++ branches/gridsim4.0-branch2/examples/FlowNetEx02/router1_report.csv 2008-08-19 00:40:05 UTC (rev 203) @@ -1,5792 +1,943 @@ -0.0, attach this ROUTER, to entity, User_0, with packet scheduler, NetUserSched_0 -0.0, attach this ROUTER, to entity, User_1, with packet scheduler, NetUserSched_1 -0.0, attach this ROUTER, with router, router2, with link, r1_r2_link, with packet scheduler, r1_Sched -0.0, register this entity to GridInformationService entity. -0.0, advertise to router, router2 -5.0, receive router ad from, router2 -15.01, -15.01, receive incoming, Packet #1, out of, 4, with id, 0, from, Output_User_0, to, Res_0, tag, 21, delay, 1.2 -15.01, break this packet into, 1 -15.01, enqueing, Packet #1, out of, 4, with id, 0, from, Output_User_0, to, Res_0, tag, 21 -15.01, -15.01, receive incoming, Packet #1, out of, 4, with id, 0, from, Output_User_1, to, Res_0, tag, 21, delay, 0.0 -15.01, break this packet into, 1 -15.01, enqueing, Packet #1, out of, 4, with id, 0, from, Output_User_1, to, Res_0, tag, 21 -16.21, dequeuing, Packet #1, out of, 4, with id, 0, from, Output_User_0, to, Res_0, tag, 21 -17.41, dequeuing, Packet #1, out of, 4, with id, 0, from, Output_User_1, to, Res_0, tag, 21 -27.01, -27.01, receive incoming, Packet #2, out of, 4, with id, 1, from, Output_User_0, to, Res_0, tag, 21, delay, 1.2 -27.01, break this packet into, 1 -27.01, enqueing, Packet #2, out of, 4, with id, 1, from, Output_User_0, to, Res_0, tag, 21 -27.01, -27.01, receive incoming, Packet #2, out of, 4, with id, 1, from, Output_User_1, to, Res_0, tag, 21, delay, 0.0 -27.01, break this packet into, 1 -27.01, enqueing, Packet #2, out of, 4, with id, 1, from, Output_User_1, to, Res_0, tag, 21 -28.21, dequeuing, Packet #2, out of, 4, with id, 1, from, Output_User_0, to, Res_0, tag, 21 -29.41, dequeuing, Packet #2, out of, 4, with id, 1, from, Output_User_1, to, Res_0, tag, 21 -39.01, -39.01, receive incoming, Packet #3, out of, 4, with id, 2, from, Output_User_0, to, Res_0, tag, 21, delay, 1.2 -39.01, break this packet into, 1 -39.01, enqueing, Packet #3, out of, 4, with id, 2, from, Output_User_0, to, Res_0, tag, 21 -39.01, -39.01, receive incoming, Packet #3, out of, 4, with id, 2, from, Output_User_1, to, Res_0, tag, 21, delay, 0.0 -39.01, break this packet into, 1 -39.01, enqueing, Packet #3, out of, 4, with id, 2, from, Output_User_1, to, Res_0, tag, 21 -40.21, dequeuing, Packet #3, out of, 4, with id, 2, from, Output_User_0, to, Res_0, tag, 21 -41.410000000000004, dequeuing, Packet #3, out of, 4, with id, 2, from, Output_User_1, to, Res_0, tag, 21 -51.01, -51.01, receive incoming, Packet #4, out of, 4, with id, 3, from, Output_User_0, to, Res_0, tag, 21, delay, 0.4 -51.01, break this packet into, 1 -51.01, enqueing, Packet #4, out of, 4, with id, 3, from, Output_User_0, to, Res_0, tag, 21 -51.01, -51.01, receive incoming, Packet #4, out of, 4, with id, 3, from, Output_User_1, to, Res_0, tag, 21, delay, 0.0 -51.01, break this packet into, 1 -51.01, enqueing, Packet #4, out of, 4, with id, 3, from, Output_User_1, to, Res_0, tag, 21 -51.41, dequeuing, Packet #4, out of, 4, with id, 3, from, Output_User_0, to, Res_0, tag, 21 -51.809999999999995, dequeuing, Packet #4, out of, 4, with id, 3, from, Output_User_1, to, Res_0, tag, 21 -55.01, -55.01, receive incoming, Packet #1, out of, 4, with id, 4, from, Output_User_1, to, Res_0, tag, 22, delay, 1.2 -55.01, break this packet into, 1 -55.01, enqueing, Packet #1, out of, 4, with id, 4, from, Output_User_1, to, Res_0, tag, 22 -55.01, -55.01, receive incoming, Packet #1, out of, 4, with id, 4, from, Output_User_0, to, Res_0, tag, 22, delay, 0.0 -55.01, break this packet into, 1 -55.01, enqueing, Packet #1, out of, 4, with id, 4, from, Output_User_0, to, Res_0, tag, 22 -56.21, dequeuing, Packet #1, out of, 4, with id, 4, from, Output_User_1, to, Res_0, tag, 22 -57.410000000000004, dequeuing, Packet #1, out of, 4, with id, 4, from, Output_User_0, to, Res_0, tag, 22 -67.01, -67.01, receive incoming, Packet #2, out of, 4, with id, 5, from, Output_User_0, to, Res_0, tag, 22, delay, 1.2 -67.01, break this packet into, 1 -67.01, enqueing, Packet #2, out of, 4, with id, 5, from, Output_User_0, to, Res_0, tag, 22 -67.01, -67.01, receive incoming, Packet #2, out of, 4, with id, 5, from, Output_User_1, to, Res_0, tag, 22, delay, 0.0 -67.01, break this packet into, 1 -67.01, enqueing, Packet #2, out of, 4, with id, 5, from, Output_User_1, to, Res_0, tag, 22 -68.21000000000001, dequeuing, Packet #2, out of, 4, with id, 5, from, Output_User_0, to, Res_0, tag, 22 -69.41000000000001, dequeuing, Packet #2, out of, 4, with id, 5, from, Output_User_1, to, Res_0, tag, 22 -79.01, -79.01, receive incoming, Packet #3, out of, 4, with id, 6, from, Output_User_1, to, Res_0, tag, 22, delay, 1.2 -79.01, break this packet into, 1 -79.01, enqueing, Packet #3, out of, 4, with id, 6, from, Output_User_1, to, Res_0, tag, 22 -79.01, -79.01, receive incoming, Packet #3, out of, 4, with id, 6, from, Output_User_0, to, Res_0, tag, 22, delay, 0.0 -79.01, break this packet into, 1 -79.01, enqueing, Packet #3, out of, 4, with id, 6, from, Output_User_0, to, Res_0, tag, 22 -80.21000000000001, dequeuing, Packet #3, out of, 4, with id, 6, from, Output_User_1, to, Res_0, tag, 22 -81.41000000000001, dequeuing, Packet #3, out of, 4, with id, 6, from, Output_User_0, to, Res_0, tag, 22 -91.01, -91.01, receive incoming, Packet #4, out of, 4, with id, 7, from, Output_User_0, to, Res_0, tag, 22, delay, 0.4 -91.01, break this packet into, 1 -91.01, enqueing, Packet #4, out of, 4, with id, 7, from, Output_User_0, to, Res_0, tag, 22 -91.01, -91.01, receive incoming, Packet #4, out of, 4, with id, 7, from, Output_User_1, to, Res_0, tag, 22, delay, 0.0 -91.01, break this packet into, 1 -91.01, enqueing, Packet #4, out of, 4, with id, 7, from, Output_User_1, to, Res_0, tag, 22 -91.41000000000001, dequeuing, Packet #4, out of, 4, with id, 7, from, Output_User_0, to, Res_0, tag, 22 -91.81000000000002, dequeuing, Packet #4, out of, 4, with id, 7, from, Output_User_1, to, Res_0, tag, 22 -95.01, -95.01, receive incoming, Packet #1, out of, 2, with id, 8, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -95.01, break this packet into, 1 -95.01, enqueing, Packet #1, out of, 2, with id, 8, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -95.01, -95.01, receive incoming, Packet #1, out of, 2, with id, 8, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -95.01, break this packet into, 1 -95.01, enqueing, Packet #1, out of, 2, with id, 8, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -96.21000000000001, dequeuing, Packet #1, out of, 2, with id, 8, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -97.41000000000001, dequeuing, Packet #1, out of, 2, with id, 8, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -107.01, -107.01, receive incoming, Packet #1, out of, 2, with id, 9, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -107.01, break this packet into, 1 -107.01, enqueing, Packet #1, out of, 2, with id, 9, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -107.01, -107.01, receive incoming, Packet #1, out of, 2, with id, 9, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -107.01, break this packet into, 1 -107.01, enqueing, Packet #1, out of, 2, with id, 9, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -108.21000000000001, dequeuing, Packet #1, out of, 2, with id, 9, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -109.41000000000001, dequeuing, Packet #1, out of, 2, with id, 9, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -119.01, -119.01, receive incoming, Packet #1, out of, 2, with id, 10, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -119.01, break this packet into, 1 -119.01, enqueing, Packet #1, out of, 2, with id, 10, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -119.01, -119.01, receive incoming, Packet #1, out of, 2, with id, 10, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -119.01, break this packet into, 1 -119.01, enqueing, Packet #1, out of, 2, with id, 10, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -120.21000000000001, dequeuing, Packet #1, out of, 2, with id, 10, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -121.41000000000001, dequeuing, Packet #1, out of, 2, with id, 10, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -126.71259946949604, -126.71259946949604, receive incoming, Packet #1, out of, 4, with id, 0, from, Output_Res_0, to, User_0, tag, 20, delay, 12.0 -126.71259946949604, break this packet into, 1 -126.71259946949604, enqueing, Packet #1, out of, 4, with id, 0, from, Output_Res_0, to, User_0, tag, 20 -131.01, -131.01, receive incoming, Packet #1, out of, 2, with id, 11, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 12.0 -131.01, break this packet into, 1 -131.01, enqueing, Packet #1, out of, 2, with id, 11, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -131.01, -131.01, receive incoming, Packet #1, out of, 2, with id, 11, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -131.01, break this packet into, 1 -131.01, enqueing, Packet #1, out of, 2, with id, 11, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -132.20999999999998, dequeuing, Packet #1, out of, 2, with id, 11, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -138.712599469496, -138.712599469496, receive incoming, Packet #2, out of, 4, with id, 1, from, Output_Res_0, to, User_0, tag, 20, delay, 0.0 -138.712599469496, break this packet into, 1 -138.712599469496, enqueing, Packet #2, out of, 4, with id, 1, from, Output_Res_0, to, User_0, tag, 20 -138.71259946949604, dequeuing, Packet #1, out of, 4, with id, 0, from, Output_Res_0, to, User_0, tag, 20 -143.01, dequeuing, Packet #1, out of, 2, with id, 11, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -143.01, -143.01, receive incoming, Packet #1, out of, 2, with id, 12, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 12.0 -143.01, break this packet into, 1 -143.01, enqueing, Packet #1, out of, 2, with id, 12, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -143.01, -143.01, receive incoming, Packet #1, out of, 2, with id, 12, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -143.01, break this packet into, 1 -143.01, enqueing, Packet #1, out of, 2, with id, 12, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -144.20999999999998, dequeuing, Packet #1, out of, 2, with id, 12, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -150.712599469496, -150.712599469496, receive incoming, Packet #3, out of, 4, with id, 2, from, Output_Res_0, to, User_0, tag, 20, delay, 0.0 -150.712599469496, break this packet into, 1 -150.712599469496, enqueing, Packet #3, out of, 4, with id, 2, from, Output_Res_0, to, User_0, tag, 20 -150.71259946949604, dequeuing, Packet #2, out of, 4, with id, 1, from, Output_Res_0, to, User_0, tag, 20 -155.01, dequeuing, Packet #1, out of, 2, with id, 12, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -155.01, -155.01, receive incoming, Packet #1, out of, 2, with id, 13, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 12.0 -155.01, break this packet into, 1 -155.01, enqueing, Packet #1, out of, 2, with id, 13, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -155.01, -155.01, receive incoming, Packet #1, out of, 2, with id, 13, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -155.01, break this packet into, 1 -155.01, enqueing, Packet #1, out of, 2, with id, 13, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -156.20999999999998, dequeuing, Packet #1, out of, 2, with id, 13, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -161.91259946949603, -161.91259946949603, receive incoming, Packet #4, out of, 4, with id, 3, from, Output_Res_0, to, User_0, tag, 20, delay, 0.0 -161.91259946949603, break this packet into, 1 -161.91259946949603, enqueing, Packet #4, out of, 4, with id, 3, from, Output_Res_0, to, User_0, tag, 20 -162.71259946949604, dequeuing, Packet #3, out of, 4, with id, 2, from, Output_Res_0, to, User_0, tag, 20 -166.712599469496, -166.712599469496, receive incoming, Packet #1, out of, 4, with id, 4, from, Output_Res_0, to, User_1, tag, 20, delay, 0.0 -166.712599469496, break this packet into, 1 -166.712599469496, enqueing, Packet #1, out of, 4, with id, 4, from, Output_Res_0, to, User_1, tag, 20 -167.01, dequeuing, Packet #1, out of, 2, with id, 13, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -167.01, -167.01, receive incoming, Packet #1, out of, 2, with id, 14, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -167.01, break this packet into, 1 -167.01, enqueing, Packet #1, out of, 2, with id, 14, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -167.01, -167.01, receive incoming, Packet #1, out of, 2, with id, 14, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -167.01, break this packet into, 1 -167.01, enqueing, Packet #1, out of, 2, with id, 14, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -168.20999999999998, dequeuing, Packet #1, out of, 2, with id, 14, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -169.40999999999997, dequeuing, Packet #1, out of, 2, with id, 14, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -174.71259946949604, dequeuing, Packet #4, out of, 4, with id, 3, from, Output_Res_0, to, User_0, tag, 20 -178.712599469496, -178.712599469496, receive incoming, Packet #2, out of, 4, with id, 5, from, Output_Res_0, to, User_1, tag, 20, delay, 0.0 -178.712599469496, break this packet into, 1 -178.712599469496, enqueing, Packet #2, out of, 4, with id, 5, from, Output_Res_0, to, User_1, tag, 20 -179.01, dequeuing, Packet #1, out of, 4, with id, 4, from, Output_Res_0, to, User_1, tag, 20 -179.01, -179.01, receive incoming, Packet #1, out of, 2, with id, 15, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -179.01, break this packet into, 1 -179.01, enqueing, Packet #1, out of, 2, with id, 15, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -179.01, -179.01, receive incoming, Packet #1, out of, 2, with id, 15, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -179.01, break this packet into, 1 -179.01, enqueing, Packet #1, out of, 2, with id, 15, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -180.20999999999998, dequeuing, Packet #1, out of, 2, with id, 15, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -181.40999999999997, dequeuing, Packet #1, out of, 2, with id, 15, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -190.712599469496, -190.712599469496, receive incoming, Packet #3, out of, 4, with id, 6, from, Output_Res_0, to, User_1, tag, 20, delay, 0.0 -190.712599469496, break this packet into, 1 -190.712599469496, enqueing, Packet #3, out of, 4, with id, 6, from, Output_Res_0, to, User_1, tag, 20 -191.01, dequeuing, Packet #2, out of, 4, with id, 5, from, Output_Res_0, to, User_1, tag, 20 -191.01, -191.01, receive incoming, Packet #1, out of, 2, with id, 16, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -191.01, break this packet into, 1 -191.01, enqueing, Packet #1, out of, 2, with id, 16, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -191.01, -191.01, receive incoming, Packet #1, out of, 2, with id, 16, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -191.01, break this packet into, 1 -191.01, enqueing, Packet #1, out of, 2, with id, 16, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -192.20999999999998, dequeuing, Packet #1, out of, 2, with id, 16, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -193.40999999999997, dequeuing, Packet #1, out of, 2, with id, 16, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -201.91259946949603, -201.91259946949603, receive incoming, Packet #4, out of, 4, with id, 7, from, Output_Res_0, to, User_1, tag, 20, delay, 0.0 -201.91259946949603, break this packet into, 1 -201.91259946949603, enqueing, Packet #4, out of, 4, with id, 7, from, Output_Res_0, to, User_1, tag, 20 -203.01, dequeuing, Packet #3, out of, 4, with id, 6, from, Output_Res_0, to, User_1, tag, 20 -203.01, -203.01, receive incoming, Packet #1, out of, 2, with id, 17, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -203.01, break this packet into, 1 -203.01, enqueing, Packet #1, out of, 2, with id, 17, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -203.01, -203.01, receive incoming, Packet #1, out of, 2, with id, 17, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -203.01, break this packet into, 1 -203.01, enqueing, Packet #1, out of, 2, with id, 17, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -204.20999999999998, dequeuing, Packet #1, out of, 2, with id, 17, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -205.40999999999997, dequeuing, Packet #1, out of, 2, with id, 17, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -205.51899946949604, -205.51899946949604, receive incoming, Packet #1, out of, 1, with id, 8, from, Output_Res_0, to, User_0, tag, 23, delay, 0.064 -205.51899946949604, break this packet into, 1 -205.51899946949604, enqueing, Packet #1, out of, 1, with id, 8, from, Output_Res_0, to, User_0, tag, 23 -205.58299946949603, dequeuing, Packet #1, out of, 1, with id, 8, from, Output_Res_0, to, User_0, tag, 23 -205.58299946949603, -205.58299946949603, receive incoming, Packet #1, out of, 1, with id, 9, from, Output_Res_0, to, User_1, tag, 23, delay, 0.0 -205.58299946949603, break this packet into, 1 -205.58299946949603, enqueing, Packet #1, out of, 1, with id, 9, from, Output_Res_0, to, User_1, tag, 23 -206.840599469496, -206.840599469496, receive incoming, Packet #1, out of, 4, with id, 10, from, Output_Res_0, to, User_0, tag, 20, delay, 12.0 -206.840599469496, break this packet into, 1 -206.840599469496, enqueing, Packet #1, out of, 4, with id, 10, from, Output_Res_0, to, User_0, tag, 20 -215.01, dequeuing, Packet #4, out of, 4, with id, 7, from, Output_Res_0, to, User_1, tag, 20 -215.01, -215.01, receive incoming, Packet #1, out of, 2, with id, 18, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -215.01, break this packet into, 1 -215.01, enqueing, Packet #1, out of, 2, with id, 18, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -215.01, -215.01, receive incoming, Packet #1, out of, 2, with id, 18, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -215.01, break this packet into, 1 -215.01, enqueing, Packet #1, out of, 2, with id, 18, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -216.20999999999998, dequeuing, Packet #1, out of, 2, with id, 18, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -218.840599469496, dequeuing, Packet #1, out of, 4, with id, 10, from, Output_Res_0, to, User_0, tag, 20 -218.840599469496, -218.840599469496, receive incoming, Packet #2, out of, 4, with id, 11, from, Output_Res_0, to, User_0, tag, 20, delay, 12.0 -218.840599469496, break this packet into, 1 -218.840599469496, enqueing, Packet #2, out of, 4, with id, 11, from, Output_Res_0, to, User_0, tag, 20 -219.01, dequeuing, Packet #1, out of, 1, with id, 9, from, Output_Res_0, to, User_1, tag, 23 -219.07399999999998, dequeuing, Packet #1, out of, 2, with id, 18, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -227.01, -227.01, receive incoming, Packet #1, out of, 2, with id, 19, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -227.01, break this packet into, 1 -227.01, enqueing, Packet #1, out of, 2, with id, 19, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -227.01, -227.01, receive incoming, Packet #1, out of, 2, with id, 19, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 12.0 -227.01, break this packet into, 1 -227.01, enqueing, Packet #1, out of, 2, with id, 19, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -228.20999999999998, dequeuing, Packet #1, out of, 2, with id, 19, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -230.840599469496, dequeuing, Packet #2, out of, 4, with id, 11, from, Output_Res_0, to, User_0, tag, 20 -230.840599469496, -230.840599469496, receive incoming, Packet #3, out of, 4, with id, 12, from, Output_Res_0, to, User_0, tag, 20, delay, 12.0 -230.840599469496, break this packet into, 1 -230.840599469496, enqueing, Packet #3, out of, 4, with id, 12, from, Output_Res_0, to, User_0, tag, 20 -239.01, dequeuing, Packet #1, out of, 2, with id, 19, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -239.01, -239.01, receive incoming, Packet #1, out of, 2, with id, 20, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -239.01, break this packet into, 1 -239.01, enqueing, Packet #1, out of, 2, with id, 20, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -239.01, -239.01, receive incoming, Packet #1, out of, 2, with id, 20, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 12.0 -239.01, break this packet into, 1 -239.01, enqueing, Packet #1, out of, 2, with id, 20, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -240.20999999999998, dequeuing, Packet #1, out of, 2, with id, 20, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -242.04059946949602, -242.04059946949602, receive incoming, Packet #4, out of, 4, with id, 13, from, Output_Res_0, to, User_0, tag, 20, delay, 0.0 -242.04059946949602, break this packet into, 1 -242.04059946949602, enqueing, Packet #4, out of, 4, with id, 13, from, Output_Res_0, to, User_0, tag, 20 -242.840599469496, dequeuing, Packet #3, out of, 4, with id, 12, from, Output_Res_0, to, User_0, tag, 20 -246.840599469496, -246.840599469496, receive incoming, Packet #1, out of, 4, with id, 14, from, Output_Res_0, to, User_1, tag, 20, delay, 0.0 -246.840599469496, break this packet into, 1 -246.840599469496, enqueing, Packet #1, out of, 4, with id, 14, from, Output_Res_0, to, User_1, tag, 20 -251.01, dequeuing, Packet #1, out of, 2, with id, 20, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -251.01, -251.01, receive incoming, Packet #1, out of, 2, with id, 21, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -251.01, break this packet into, 1 -251.01, enqueing, Packet #1, out of, 2, with id, 21, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -251.01, -251.01, receive incoming, Packet #1, out of, 2, with id, 21, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -251.01, break this packet into, 1 -251.01, enqueing, Packet #1, out of, 2, with id, 21, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -252.20999999999998, dequeuing, Packet #1, out of, 2, with id, 21, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -254.840599469496, dequeuing, Packet #4, out of, 4, with id, 13, from, Output_Res_0, to, User_0, tag, 20 -258.840599469496, -258.840599469496, receive incoming, Packet #2, out of, 4, with id, 15, from, Output_Res_0, to, User_1, tag, 20, delay, 0.0 -258.840599469496, break this packet into, 1 -258.840599469496, enqueing, Packet #2, out of, 4, with id, 15, from, Output_Res_0, to, User_1, tag, 20 -263.01, dequeuing, Packet #1, out of, 4, with id, 14, from, Output_Res_0, to, User_1, tag, 20 -263.01, -263.01, receive incoming, Packet #1, out of, 2, with id, 22, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -263.01, break this packet into, 1 -263.01, enqueing, Packet #1, out of, 2, with id, 22, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -263.01, -263.01, receive incoming, Packet #1, out of, 2, with id, 22, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -263.01, break this packet into, 1 -263.01, enqueing, Packet #1, out of, 2, with id, 22, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -264.21, dequeuing, Packet #1, out of, 2, with id, 22, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -270.840599469496, -270.840599469496, receive incoming, Packet #3, out of, 4, with id, 16, from, Output_Res_0, to, User_1, tag, 20, delay, 0.0 -270.840599469496, break this packet into, 1 -270.840599469496, enqueing, Packet #3, out of, 4, with id, 16, from, Output_Res_0, to, User_1, tag, 20 -275.01, dequeuing, Packet #1, out of, 2, with id, 21, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -275.01, -275.01, receive incoming, Packet #1, out of, 2, with id, 23, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -275.01, break this packet into, 1 -275.01, enqueing, Packet #1, out of, 2, with id, 23, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -275.01, -275.01, receive incoming, Packet #1, out of, 2, with id, 23, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -275.01, break this packet into, 1 -275.01, enqueing, Packet #1, out of, 2, with id, 23, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -276.21, dequeuing, Packet #1, out of, 2, with id, 23, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -282.040599469496, -282.040599469496, receive incoming, Packet #4, out of, 4, with id, 17, from, Output_Res_0, to, User_1, tag, 20, delay, 0.0 -282.040599469496, break this packet into, 1 -282.040599469496, enqueing, Packet #4, out of, 4, with id, 17, from, Output_Res_0, to, User_1, tag, 20 -287.01, dequeuing, Packet #2, out of, 4, with id, 15, from, Output_Res_0, to, User_1, tag, 20 -287.01, -287.01, receive incoming, Packet #1, out of, 2, with id, 24, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -287.01, break this packet into, 1 -287.01, enqueing, Packet #1, out of, 2, with id, 24, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -287.01, -287.01, receive incoming, Packet #1, out of, 2, with id, 24, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -287.01, break this packet into, 1 -287.01, enqueing, Packet #1, out of, 2, with id, 24, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -288.21, dequeuing, Packet #1, out of, 2, with id, 24, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -299.01, dequeuing, Packet #1, out of, 2, with id, 22, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -299.01, -299.01, receive incoming, Packet #1, out of, 2, with id, 25, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -299.01, break this packet into, 1 -299.01, enqueing, Packet #1, out of, 2, with id, 25, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -299.01, -299.01, receive incoming, Packet #1, out of, 2, with id, 25, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -299.01, break this packet into, 1 -299.01, enqueing, Packet #1, out of, 2, with id, 25, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -300.21, dequeuing, Packet #1, out of, 2, with id, 25, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -311.01, dequeuing, Packet #3, out of, 4, with id, 16, from, Output_Res_0, to, User_1, tag, 20 -311.01, -311.01, receive incoming, Packet #1, out of, 2, with id, 26, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -311.01, break this packet into, 1 -311.01, enqueing, Packet #1, out of, 2, with id, 26, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -311.01, -311.01, receive incoming, Packet #1, out of, 2, with id, 26, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -311.01, break this packet into, 1 -311.01, enqueing, Packet #1, out of, 2, with id, 26, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -312.21, dequeuing, Packet #1, out of, 2, with id, 26, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -323.01, dequeuing, Packet #1, out of, 2, with id, 23, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -323.01, -323.01, receive incoming, Packet #1, out of, 2, with id, 27, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -323.01, break this packet into, 1 -323.01, enqueing, Packet #1, out of, 2, with id, 27, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -323.01, -323.01, receive incoming, Packet #1, out of, 2, with id, 27, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -323.01, break this packet into, 1 -323.01, enqueing, Packet #1, out of, 2, with id, 27, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -324.21, dequeuing, Packet #1, out of, 2, with id, 27, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -335.01, dequeuing, Packet #4, out of, 4, with id, 17, from, Output_Res_0, to, User_1, tag, 20 -335.01, -335.01, receive incoming, Packet #1, out of, 2, with id, 28, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -335.01, break this packet into, 1 -335.01, enqueing, Packet #1, out of, 2, with id, 28, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -335.01, -335.01, receive incoming, Packet #1, out of, 2, with id, 28, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -335.01, break this packet into, 1 -335.01, enqueing, Packet #1, out of, 2, with id, 28, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -336.21, dequeuing, Packet #1, out of, 2, with id, 28, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -337.40999999999997, dequeuing, Packet #1, out of, 2, with id, 28, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -339.01, dequeuing, Packet #1, out of, 2, with id, 24, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -347.01, -347.01, receive incoming, Packet #1, out of, 2, with id, 29, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -347.01, break this packet into, 1 -347.01, enqueing, Packet #1, out of, 2, with id, 29, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -347.01, -347.01, receive incoming, Packet #1, out of, 2, with id, 29, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 0.0 -347.01, break this packet into, 1 -347.01, enqueing, Packet #1, out of, 2, with id, 29, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -348.21, dequeuing, Packet #1, out of, 2, with id, 29, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -349.40999999999997, dequeuing, Packet #1, out of, 2, with id, 29, from, Output_User_0, to, Res_0, tag, GridSimTags.JUNK_PKT -351.01, dequeuing, Packet #1, out of, 2, with id, 25, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -359.01, -359.01, receive incoming, Packet #1, out of, 2, with id, 30, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -359.01, break this packet into, 1 -359.01, enqueing, Packet #1, out of, 2, with id, 30, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -359.01, -359.01, receive incoming, Packet #1, out of, 2, with id, 30, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -359.01, break this packet into, 1 -359.01, enqueing, Packet #1, out of, 2, with id, 30, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -360.21, dequeuing, Packet #1, out of, 2, with id, 30, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -363.01, dequeuing, Packet #1, out of, 2, with id, 26, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -371.01, -371.01, receive incoming, Packet #1, out of, 2, with id, 31, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -371.01, break this packet into, 1 -371.01, enqueing, Packet #1, out of, 2, with id, 31, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -371.01, -371.01, receive incoming, Packet #1, out of, 2, with id, 31, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -371.01, break this packet into, 1 -371.01, enqueing, Packet #1, out of, 2, with id, 31, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -372.21, dequeuing, Packet #1, out of, 2, with id, 31, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -375.01, dequeuing, Packet #1, out of, 2, with id, 27, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -383.01, -383.01, receive incoming, Packet #1, out of, 2, with id, 32, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -383.01, break this packet into, 1 -383.01, enqueing, Packet #1, out of, 2, with id, 32, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -383.01, -383.01, receive incoming, Packet #1, out of, 2, with id, 32, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -383.01, break this packet into, 1 -383.01, enqueing, Packet #1, out of, 2, with id, 32, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -384.21, dequeuing, Packet #1, out of, 2, with id, 32, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -387.01, dequeuing, Packet #1, out of, 2, with id, 30, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -395.01, -395.01, receive incoming, Packet #1, out of, 2, with id, 33, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT, delay, 0.0 -395.01, break this packet into, 1 -395.01, enqueing, Packet #1, out of, 2, with id, 33, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -395.01, -395.01, receive incoming, Packet #1, out of, 2, with id, 33, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT, delay, 1.2 -395.01, break this packet into, 1 -395.01, enqueing, Packet #1, out of, 2, with id, 33, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -396.21, dequeuing, Packet #1, out of, 2, with id, 33, from, Output_User_1, to, Res_0, tag, GridSimTags.JUNK_PKT -399.01, dequeuing, Packet #1, out of, 2, with id, 31, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -407.01, -407.01, receive incoming, Packet #1, out of, 4, with id, 34, from, Output_User_1, to, Res_0, tag, 21, delay, 1.2 -407.01, break this packet into, 1 -407.01, enqueing, Packet #1, out of, 4, with id, 34, from, Output_User_1, to, Res_0, tag, 21 -407.01, -407.01, receive incoming, Packet #1, out of, 4, with id, 34, from, Output_User_0, to, Res_0, tag, 21, delay, 0.0 -407.01, break this packet into, 1 -407.01, enqueing, Packet #1, out of, 4, with id, 34, from, Output_User_0, to, Res_0, tag, 21 -408.21, dequeuing, Packet #1, out of, 4, with id, 34, from, Output_User_1, to, Res_0, tag, 21 -409.40999999999997, dequeuing, Packet #1, out of, 4, with id, 34, from, Output_User_0, to, Res_0, tag, 21 -411.01, dequeuing, Packet #1, out of, 2, with id, 32, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -419.01, -419.01, receive incoming, Packet #2, out of, 4, with id, 35, from, Output_User_1, to, Res_0, tag, 21, delay, 1.2 -419.01, break this packet into, 1 -419.01, enqueing, Packet #2, out of, 4, with id, 35, from, Output_User_1, to, Res_0, tag, 21 -419.01, -419.01, receive incoming, Packet #2, out of, 4, with id, 35, from, Output_User_0, to, Res_0, tag, 21, delay, 0.0 -419.01, break this packet into, 1 -419.01, enqueing, Packet #2, out of, 4, with id, 35, from, Output_User_0, to, Res_0, tag, 21 -420.21, dequeuing, Packet #2, out of, 4, with id, 35, from, Output_User_1, to, Res_0, tag, 21 -421.40999999999997, dequeuing, Packet #2, out of, 4, with id, 35, from, Output_User_0, to, Res_0, tag, 21 -423.01, dequeuing, Packet #1, out of, 2, with id, 33, from, Output_User_0, to, User_1, tag, GridSimTags.JUNK_PKT -431.01, -431.01, receive incoming, Packet #3, out of, 4, with id, 36, from, Output_User_0, to, Res_0, tag, 21, delay, 1.2 -431.01, break this packet into, 1 -431.01, enqueing, Packet #3, out of, 4, with id, 36, from, Output_User_0, to, Res_0, tag, 21 -431.01, -431.01, receive incoming, Packet #3, out of, 4, with id, 36, from, Output_User_1, to, Res_0, tag, 21, delay, 0.0 -431.01, break this packet into, 1 -431.01, enqueing, Packet #3, out of, 4, with id, 36, from, Output_User_1, to, Res_0, tag, 21 -432.21, dequeuing, Packet #3, out of, 4, with id, 36, from, Output_User_0, to, Res_0, tag, 21 -433.40999999999997, dequeuing, Packet #3, out of, 4, with id, 36, from, Output_User_1, to, Res_0, tag, 21 -443.01, -443.01, receive incoming, Packet #4, out of, 4, with id, 37, from, Output_User_0, to, Res_0, tag, 21, delay, 0.4 -443.01, break this packet into, 1 -443.01, enqueing, Packet #4, out of, 4, with id, 37, from, Output_User_0, to, Res_0, tag, 21 -443.01, -443.01, receive incoming, Packet #4, out of, 4, with id, 37, from, Output_User_1, to, Res_0, tag, 21, delay, 0.0 -443.01, break this packet into, 1 -443.01, enqueing, Packet #4, out of, 4, with id, 37, from, Output_User_1, to, Res_0, tag, 21 -443.40999999999997, dequeuing, Packet #4, out of, 4, with id, 37, from, Output_User_0, to, Res_0, tag, 21 -443.80999999999995, dequeuing, Packet #4, out of, 4, with id, 37, from, Output_User_1, to, Res_0, tag, 21 -447.01, -447.01, receive incoming, Packet #1, out of, 4, with id, 38, from, Output_User_1, to, Res_0, tag, 22, delay, 1.2 -447.01, break this packet into, 1 -447.01, enqueing, Packet #1, out of, 4, with id, 38, from, Output_User_1, to, Res_0, tag, 22 -447.01, -447.01, receive incoming, Packet #1, out of, 4, with id, 38, from, Output_User_0, to, Res_0, tag, 22, delay, 0.0 -447.01, break this packet into, 1 -447.01, enqueing, Packet #1, ... [truncated message content] |
From: <bro...@us...> - 2008-08-19 00:35:38
|
Revision: 202 http://gridsim.svn.sourceforge.net/gridsim/?rev=202&view=rev Author: brobergj Date: 2008-08-19 00:35:48 +0000 (Tue, 19 Aug 2008) Log Message: ----------- Modified Paths: -------------- branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetUser.java Modified: branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetUser.java =================================================================== --- branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetUser.java 2008-08-18 09:52:58 UTC (rev 201) +++ branches/gridsim4.0-branch2/examples/FlowNetEx01/FlowNetUser.java 2008-08-19 00:35:48 UTC (rev 202) @@ -84,7 +84,10 @@ */ public void body() { - int packetSize = 5242880; // packet size in bytes [5MB] + int packetSize = 524288000; // packet size in bytes [5MB] + //int packetSize = 52428800; // packet size in bytes [50MB] + //int packetSize = 524288000; // packet size in bytes [500MB] + //int packetSize = 5242880000; // packet size in bytes [5000MB] int size = 3; // number of packets sent int i = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-08-18 09:52:50
|
Revision: 201 http://gridsim.svn.sourceforge.net/gridsim/?rev=201&view=rev Author: sulistio Date: 2008-08-18 09:52:58 +0000 (Mon, 18 Aug 2008) Log Message: ----------- modify this example to use the new gridsim.net.flow package Modified Paths: -------------- trunk/examples/DataGrid/example4/DataGridSim.java trunk/examples/DataGrid/example4/SimUser.java Modified: trunk/examples/DataGrid/example4/DataGridSim.java =================================================================== --- trunk/examples/DataGrid/example4/DataGridSim.java 2008-08-12 02:53:06 UTC (rev 200) +++ trunk/examples/DataGrid/example4/DataGridSim.java 2008-08-18 09:52:58 UTC (rev 201) @@ -15,8 +15,8 @@ import gridsim.util.NetworkReader; import java.util.Calendar; import java.util.LinkedList; +import gridsim.net.flow.*; // To use the new flow network package - GridSim 4.2 - /** * This is the main class of the simulation package. It reads all the parameters * from a file, constructs the simulation defined in the configuration files, @@ -45,6 +45,7 @@ // Initialize the GridSim package System.out.println("Initializing GridSim package"); GridSim.init(num_user, calendar, trace_flag, gisFlag); + GridSim.initNetworkType(GridSimTags.NET_FLOW_LEVEL); // set the GIS into DataGIS that handles specifically for data grid // scenarios @@ -60,11 +61,13 @@ LinkedList files = FilesReader.read(ParameterReader.filesFilename); //read topology - LinkedList routerList = NetworkReader.createFIFO(ParameterReader.networkFilename); + //LinkedList routerList = NetworkReader.createFIFO(ParameterReader.networkFilename); + LinkedList routerList = NetworkReader.createFlow(ParameterReader.networkFilename); //attach central RC entity to one of the routers //Create a central RC - Link l = new SimpleLink("rc_link", baud_rate, propDelay, mtu); + //Link l = new SimpleLink("rc_link", baud_rate, propDelay, mtu); + Link l = new FlowLink("rc_link", baud_rate, propDelay, mtu); TopRegionalRC rc = new TopRegionalRC(l); //connect the TopRC to a router specified in the parameters file Modified: trunk/examples/DataGrid/example4/SimUser.java =================================================================== --- trunk/examples/DataGrid/example4/SimUser.java 2008-08-12 02:53:06 UTC (rev 200) +++ trunk/examples/DataGrid/example4/SimUser.java 2008-08-18 09:52:58 UTC (rev 201) @@ -12,8 +12,8 @@ import gridsim.net.SimpleLink; import java.util.ArrayList; import java.util.Iterator; +import gridsim.net.flow.*; // To use the new flow network package - GridSim 4.2 - /** * This class defines a user which executes a set of commands. * @author Uros Cibej and Anthony Sulistio @@ -25,7 +25,8 @@ // constructor SimUser(String name, double baud_rate, double delay, int MTU) throws Exception { - super(name, new SimpleLink(name + "_link", baud_rate, delay, MTU)); + //super(name, new SimpleLink(name + "_link", baud_rate, delay, MTU)); + super(name, new FlowLink(name + "_link", baud_rate, delay, MTU)); this.name_ = name; this.tasks = new ArrayList(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-08-12 02:52:57
|
Revision: 200 http://gridsim.svn.sourceforge.net/gridsim/?rev=200&view=rev Author: sulistio Date: 2008-08-12 02:53:06 +0000 (Tue, 12 Aug 2008) Log Message: ----------- create a new static variable MAX_HOP_COUNT in Router.java. Aim: you can set this variable to a higher number for a large network topology. Modified Paths: -------------- trunk/source/gridsim/net/FloodingRouter.java trunk/source/gridsim/net/RIPRouter.java trunk/source/gridsim/net/Router.java trunk/source/gridsim/net/flow/FlowRouter.java Modified: trunk/source/gridsim/net/FloodingRouter.java =================================================================== --- trunk/source/gridsim/net/FloodingRouter.java 2008-08-06 04:10:21 UTC (rev 199) +++ trunk/source/gridsim/net/FloodingRouter.java 2008-08-12 02:53:06 UTC (rev 200) @@ -642,7 +642,7 @@ FloodAdPack ad = (FloodAdPack)ev.get_data(); // prevent count-to-infinity - if (ad.getHopCount() > 15) { + if (ad.getHopCount() > Router.MAX_HOP_COUNT) { return; } Modified: trunk/source/gridsim/net/RIPRouter.java =================================================================== --- trunk/source/gridsim/net/RIPRouter.java 2008-08-06 04:10:21 UTC (rev 199) +++ trunk/source/gridsim/net/RIPRouter.java 2008-08-12 02:53:06 UTC (rev 200) @@ -642,7 +642,7 @@ RIPAdPack ad = (RIPAdPack)ev.get_data(); // prevent count-to-infinity - if (ad.getHopCount() > 15) { + if (ad.getHopCount() > Router.MAX_HOP_COUNT) { return; } Modified: trunk/source/gridsim/net/Router.java =================================================================== --- trunk/source/gridsim/net/Router.java 2008-08-06 04:10:21 UTC (rev 199) +++ trunk/source/gridsim/net/Router.java 2008-08-12 02:53:06 UTC (rev 200) @@ -59,6 +59,14 @@ */ public abstract class Router extends Sim_entity { + /** An attribute that denotes the maximum number of hopcount used for + * advertising adjacent routers. The default value is 15. + * This attribute is used to prevent from a count-to-infinity scenario. + * Note that if you have a large topology with many routers, you can + * set this attribute to a higher number. + */ + public static int MAX_HOP_COUNT = 15; + /** An attribute that logs incoming and outgoing packets into a file. * Use {@link #write(String)} to log or record the information. */ Modified: trunk/source/gridsim/net/flow/FlowRouter.java =================================================================== --- trunk/source/gridsim/net/flow/FlowRouter.java 2008-08-06 04:10:21 UTC (rev 199) +++ trunk/source/gridsim/net/flow/FlowRouter.java 2008-08-12 02:53:06 UTC (rev 200) @@ -647,7 +647,7 @@ RIPAdPack ad = (RIPAdPack)ev.get_data(); // prevent count-to-infinity - if (ad.getHopCount() > 15) { + if (ad.getHopCount() > Router.MAX_HOP_COUNT) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-08-06 04:10:13
|
Revision: 199 http://gridsim.svn.sourceforge.net/gridsim/?rev=199&view=rev Author: marcos_dias Date: 2008-08-06 04:10:21 +0000 (Wed, 06 Aug 2008) Log Message: ----------- This update includes methods to allow the update of AvailabilityInfo objects. Modified Paths: -------------- branches/gridsim4.0-branch3/source/eduni/simjava/Sim_entity.java branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java Modified: branches/gridsim4.0-branch3/source/eduni/simjava/Sim_entity.java =================================================================== --- branches/gridsim4.0-branch3/source/eduni/simjava/Sim_entity.java 2008-08-04 02:39:22 UTC (rev 198) +++ branches/gridsim4.0-branch3/source/eduni/simjava/Sim_entity.java 2008-08-06 04:10:21 UTC (rev 199) @@ -53,7 +53,6 @@ * </ul> * <p> * @see Sim_event - * @see Sim_stat * @see Sim_system * @version 0.2, 11 July 2002 * @author Costas Simatos @@ -92,30 +91,6 @@ } /** - *The constructor for use with the <code>eduni.simanim</code> animation package. - * @param name The name to be associated with this entity - * @param image_name The name of the gif image file for this entity's - * icon (without the .gif extension). - * @param x The X co-ordinate at which the entity should be drawn - * @param y The Y co-ordinate at which the entity should be drawn - */ - public Sim_entity(String name, String image_name, int x, int y) { - if (name.indexOf(" ") != -1) { - throw new Sim_exception("Sim_entity: Entity names can't contain spaces."); - } - this.name = name; - me = -1; - state = RUNNABLE; - restart = new Semaphore(0); - reset = new Semaphore(0); - ports = new ArrayList(); - generators = new ArrayList(); - // Add this to Sim_system automatically - Sim_system.add(this); - super.setName(name); // sets the thread name to ease debugging - } - - /** * Get the name of this entity * @return The entity's name */ @@ -361,17 +336,6 @@ } /** - * Put an event back on the deferred queue. - * @param ev The event to put back - */ - public void sim_putback(Sim_event ev) { - if (!Sim_system.running()) { - return; - } - Sim_system.putback((Sim_event)ev.clone()); - } - - /** * Get the first event matching a predicate from the deferred queue, or if none match, * wait for a matching event to arrive. * @param p The predicate to match Modified: branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java =================================================================== --- branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java 2008-08-04 02:39:22 UTC (rev 198) +++ branches/gridsim4.0-branch3/source/eduni/simjava/Sim_system.java 2008-08-06 04:10:21 UTC (rev 199) @@ -330,8 +330,8 @@ for (int i=0; i < entities_size; i++) { ent = (Sim_entity)entities.get(i); if (ent.get_state() == Sim_entity.RUNNABLE) { - ent.restart(); - num_started++; + ent.restart(); + num_started++; } } // Wait for them all to halt @@ -522,9 +522,6 @@ return previousSize < future.size(); } - // Puts an event into the deferred queue - static synchronized void putback(Sim_event ev) { deferred.add_event(ev); } - // // Private internal methods // Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-08-04 02:39:22 UTC (rev 198) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-08-06 04:10:21 UTC (rev 199) @@ -133,105 +133,6 @@ return getPotentialStartTime(readyTime, duration, reqPE, Double.MAX_VALUE); } -// /** -// * Scans the entries in the availability info object returns the start -// * time of the first time frame over which a request with the characteristics -// * provided can be scheduled. -// * @param readyTime the method will consider potential start times -// * further in time than the value given by <tt>readyTime</tt>. -// * @param duration the duration of the request -// * @param reqPE the number of PEs required -// * @return the start time or <tt>-1</tt> if not found. -// */ -// public double getPotentialStartTime(double readyTime, -// int duration, int reqPE) { -// -// if(readyTime < startTime_) -// readyTime = startTime_; -// -// if(readyTime > finishTime_) -// return UNKNOWN; -// -// // the anchor index, the entry in the profile where -// // the request would be placed OR the closest entry to the -// // point where the anchor of the request would be placed -// int anchorIndex = -1; -// -// // a pointer to the anchor entry (described above) -// AvailabilityInfoEntry anchorEntry = null; -// -// double potStartTime = -1; // keep the potential start time of the request -// double potFinishTime = -1; // store the gridlet's expected finish time -// int length = super.size(); -// -// anchorEntry = getPrecedingEntry(readyTime); -// int firstAnchorIndex = super.indexOf(anchorEntry); -// if(firstAnchorIndex == -1) -// firstAnchorIndex = 0; -// -// for(int j=firstAnchorIndex; j<length; j++) { -// AvailabilityInfoEntry entry = super.get(j); -// anchorIndex = super.indexOf(entry); -// -// // scan the profile until an entry with enough PEs is found -// if(entry.getNumPE() < reqPE) { -// continue; -// } -// else { -// -// // sets the start time as the time of the entry -// if(entry.getTime() < readyTime) -// potStartTime = readyTime; -// else -// potStartTime = entry.getTime(); -// -// // calculates when the finish time will be if -// // the gridlet is put at this position -// potFinishTime = potStartTime + duration; -// -// // if an entry with enough PEs is found, then scan the list -// // from that point onwards analysing the intersection of -// // the ranges available in the entries until the -// // request expected completion time -// PERangeList intersectList = entry.getAvailRanges().clone(); -// -// // Look for the intersection of available ranges from -// // the anchor until the end of the profile or until -// // the entries are further than the expected completion time -// for(int i=anchorIndex+1; i<length; i++){ -// AvailabilityInfoEntry nextEntry = super.get(i); -// if(nextEntry.getTime() > potFinishTime){ -// break; -// } -// else{ -// // if the finish time is equals to the entry time, so there -// // is no need to check the intersection -// if(nextEntry.getTime() < potFinishTime) { -// intersectList = PERangeList.intersection(intersectList, -// nextEntry.getAvailRanges()); -// -// if(intersectList == null || intersectList.getNumPE() < reqPE) { -// break; -// } -// } -// } -// } -// // If a time slot with enough PEs has been found, then stop the search -// if(intersectList != null && intersectList.getNumPE() >= reqPE) { -// break; -// } -// } -// } -// -// // if the potential finish time is larger than the end time of -// // this list, then the request cannot be scheduled -// if(potFinishTime > finishTime_) { -// potStartTime = UNKNOWN; -// } -// -// return potStartTime; -// } - /** * Scans the entries in the availability info object returns the start * time of the first time frame over which a request with the characteristics @@ -607,8 +508,116 @@ info.setFinishTime(finishTime); return info; } + + /** + * Updates the availability information object. That is, reserves a set of + * nodes to serve a request with the characteristics provided. + * @param startTime the start time of the request. + * @param finishTime the finish time of the request. + * @param selected the ranges of PEs selected for the job + */ + public void allocate(double startTime, + double finishTime, PERangeList selected) { + if(startTime == finishTime_) + return; + + // check whether a new tail is needed to mark the end of the request + if(finishTime < finishTime_) { + AvailabilityInfoEntry tailEntry = getPrecedingEntry(finishTime); + if(tailEntry.getTime() < finishTime) { + AvailabilityInfoEntry newTail = tailEntry.clone(finishTime); + super.add(super.indexOf(tailEntry) + 1, newTail); + } + else if (tailEntry.getTime() == finishTime) { + tailEntry.increaseGridlet(); + } + } + + // check whether a new anchor is needed to mark the start of the request + AvailabilityInfoEntry anchorEntry = getPrecedingEntry(startTime); + if(anchorEntry.getTime() < startTime) { + AvailabilityInfoEntry newAnchor = anchorEntry.clone(startTime); + super.add(super.indexOf(anchorEntry) + 1, newAnchor); + anchorEntry = newAnchor; + } + else { + anchorEntry.increaseGridlet(); + } + + AvailabilityInfoEntry entry = null; + + Iterator<AvailabilityInfoEntry> it = super.iterator(); + while(it.hasNext()) { + entry = it.next(); + if(entry.getTime() >= finishTime) + break; + else if (entry.getTime() < startTime){ + continue; + } + + PERangeList difference = PERangeList.difference(entry.getAvailRanges(), selected); + entry.setAvailRanges(difference); + } + } + /** + * Returns a given time slot to this availability object + * @param slot the time slot to be returned + */ + public void addTimeSlot(TimeSlot slot) { + double startTime = slot.getStartTime(); + double endTime = slot.getFinishTime(); + + if(startTime < startTime_) { + startTime = startTime_; + } + + Iterator<AvailabilityInfoEntry> it = super.iterator(); + while(it.hasNext()) { + AvailabilityInfoEntry entry = it.next(); + + double entryTime = entry.getTime(); + if(entryTime < startTime) { + continue; + } + else if(entryTime > endTime) { + break; + } + else { + if(entryTime == endTime) { + entry.decreaseGridlet(); + if(entry.getNumGridlets() == 0) { + it.remove(); + } + continue; + } + + if(entryTime == startTime) { + entry.decreaseGridlet(); + if(entry.getNumGridlets() == 0) { + it.remove(); + continue; + } + } + + // adds the ranges to the list of free ranges in + // the entry, and consolidates the ranges to avoid fragments + // As the list may be null, make sure that the list will not be + // null so the released ranges can be added back to it + PERangeList listEntry = entry.getAvailRanges(); + if(listEntry == null){ + listEntry = new PERangeList(); + } + + listEntry.addAll(slot.getPERanges().clone()); + listEntry.mergePERanges(); + entry.setAvailRanges(listEntry); + } + } + } + + /** * Creates a string representation of the list * @return a string representation */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-08-04 02:39:23
|
Revision: 198 http://gridsim.svn.sourceforge.net/gridsim/?rev=198&view=rev Author: sulistio Date: 2008-08-04 02:39:22 +0000 (Mon, 04 Aug 2008) Log Message: ----------- add the copyright statement at the class header for each file. Modified Paths: -------------- 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/SpaceShared.java trunk/source/gridsim/Stat.java trunk/source/gridsim/TimeShared.java trunk/source/gridsim/auction/Auction.java trunk/source/gridsim/auction/AuctionObserver.java trunk/source/gridsim/auction/AuctionTags.java trunk/source/gridsim/auction/Auctioneer.java trunk/source/gridsim/auction/ContinuousDoubleAuction.java trunk/source/gridsim/auction/DoubleAuction.java trunk/source/gridsim/auction/DutchAuction.java trunk/source/gridsim/auction/EnglishAuction.java trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java trunk/source/gridsim/auction/Message.java trunk/source/gridsim/auction/MessageAsk.java trunk/source/gridsim/auction/MessageBid.java trunk/source/gridsim/auction/MessageCallForBids.java trunk/source/gridsim/auction/MessageInformOutcome.java trunk/source/gridsim/auction/MessageInformStart.java trunk/source/gridsim/auction/MessageRejectBid.java trunk/source/gridsim/auction/MessageRejectCallForBid.java trunk/source/gridsim/auction/OneSidedAuction.java trunk/source/gridsim/auction/Responder.java trunk/source/gridsim/auction/ReverseDutchAuction.java trunk/source/gridsim/auction/ReverseEnglishAuction.java trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.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/index/AbstractGIS.java trunk/source/gridsim/index/RegionalGIS.java trunk/source/gridsim/net/FIFOScheduler.java trunk/source/gridsim/net/FloodAdPack.java trunk/source/gridsim/net/FloodingRouter.java trunk/source/gridsim/net/InfoPacket.java trunk/source/gridsim/net/Input.java trunk/source/gridsim/net/Link.java trunk/source/gridsim/net/NetIO.java trunk/source/gridsim/net/NetPacket.java trunk/source/gridsim/net/Output.java trunk/source/gridsim/net/Packet.java trunk/source/gridsim/net/PacketScheduler.java trunk/source/gridsim/net/RIPAdPack.java trunk/source/gridsim/net/RIPRouter.java trunk/source/gridsim/net/RateControlledRouter.java trunk/source/gridsim/net/RateControlledScheduler.java trunk/source/gridsim/net/Router.java trunk/source/gridsim/net/SCFQScheduler.java trunk/source/gridsim/net/SimpleLink.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/NetworkReader.java trunk/source/gridsim/util/SimReport.java trunk/source/gridsim/util/TrafficGenerator.java trunk/source/gridsim/util/Workload.java Modified: trunk/source/gridsim/ARGridResource.java =================================================================== --- trunk/source/gridsim/ARGridResource.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ARGridResource.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ARGridResource.java,v 1.19 2005/10/21 09:23:20 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ARObject.java =================================================================== --- trunk/source/gridsim/ARObject.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ARObject.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ARObject.java,v 1.8 2004/11/01 02:52:33 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ARPolicy.java =================================================================== --- trunk/source/gridsim/ARPolicy.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ARPolicy.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ARPolicy.java,v 1.19 2007/08/10 01:50:34 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ARSimpleSpaceShared.java =================================================================== --- trunk/source/gridsim/ARSimpleSpaceShared.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ARSimpleSpaceShared.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ARSimpleSpaceShared.java,v 1.11 2005/10/21 09:23:20 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Accumulator.java =================================================================== --- trunk/source/gridsim/Accumulator.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Accumulator.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Accumulator.java,v 1.14 2007/10/18 01:26:48 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/AdvanceReservation.java =================================================================== --- trunk/source/gridsim/AdvanceReservation.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/AdvanceReservation.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AdvanceReservation.java,v 1.40 2005/10/21 09:23:20 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/AllocPolicy.java =================================================================== --- trunk/source/gridsim/AllocPolicy.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/AllocPolicy.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AllocPolicy.java,v 1.45 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2003, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridInformationService.java =================================================================== --- trunk/source/gridsim/GridInformationService.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridInformationService.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridInformationService.java,v 1.32 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridResource.java =================================================================== --- trunk/source/gridsim/GridResource.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridResource.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridResource.java,v 1.62 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSim.java =================================================================== --- trunk/source/gridsim/GridSim.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSim.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSim.java,v 1.67 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimCore.java =================================================================== --- trunk/source/gridsim/GridSimCore.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimCore.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimCore.java,v 1.14 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2004, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimRandom.java =================================================================== --- trunk/source/gridsim/GridSimRandom.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimRandom.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimRandom.java,v 1.13 2004/11/01 02:52:35 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimShutdown.java =================================================================== --- trunk/source/gridsim/GridSimShutdown.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimShutdown.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimShutdown.java,v 1.21 2005/03/28 01:31:37 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimStandardPE.java =================================================================== --- trunk/source/gridsim/GridSimStandardPE.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimStandardPE.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimStandardPE.java,v 1.11 2004/11/01 02:52:35 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridSimTags.java =================================================================== --- trunk/source/gridsim/GridSimTags.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridSimTags.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridSimTags.java,v 1.49 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridStatistics.java =================================================================== --- trunk/source/gridsim/GridStatistics.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridStatistics.java 2008-08-04 02:39:22 UTC (rev 198) @@ -5,7 +5,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridStatistics.java,v 1.21 2004/11/01 02:52:35 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridUser.java =================================================================== --- trunk/source/gridsim/GridUser.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridUser.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridUser.java,v 1.7 2006/04/21 02:46:45 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Gridlet.java =================================================================== --- trunk/source/gridsim/Gridlet.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Gridlet.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Gridlet.java,v 1.37 2007/08/30 02:18:10 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/GridletList.java =================================================================== --- trunk/source/gridsim/GridletList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/GridletList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: GridletList.java,v 1.11 2004/11/01 02:52:35 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/IO_data.java =================================================================== --- trunk/source/gridsim/IO_data.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/IO_data.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: IO_data.java,v 1.15 2005/06/21 08:54:37 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Machine.java =================================================================== --- trunk/source/gridsim/Machine.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Machine.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Machine.java,v 1.14 2007/08/20 02:13:29 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ Modified: trunk/source/gridsim/MachineList.java =================================================================== --- trunk/source/gridsim/MachineList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/MachineList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MachineList.java,v 1.15 2007/08/20 02:13:29 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/PE.java =================================================================== --- trunk/source/gridsim/PE.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/PE.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: PE.java,v 1.15 2007/08/30 01:20:19 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/PEList.java =================================================================== --- trunk/source/gridsim/PEList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/PEList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: PEList.java,v 1.14 2007/08/20 02:13:52 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ParameterException.java =================================================================== --- trunk/source/gridsim/ParameterException.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ParameterException.java 2008-08-04 02:39:22 UTC (rev 198) @@ -8,7 +8,8 @@ * October 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Copyright (c) 2004, The University of Melbourne, Australia and + * National University of Singapore * ParameterException.java - Thrown for illegal parameters * */ Modified: trunk/source/gridsim/ResGridlet.java =================================================================== --- trunk/source/gridsim/ResGridlet.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResGridlet.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResGridlet.java,v 1.27 2005/07/19 07:36:41 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ResGridletList.java =================================================================== --- trunk/source/gridsim/ResGridletList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResGridletList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResGridletList.java,v 1.10 2004/11/01 02:52:36 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ResourceCalendar.java =================================================================== --- trunk/source/gridsim/ResourceCalendar.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResourceCalendar.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResourceCalendar.java,v 1.16 2005/04/01 06:30:36 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ Modified: trunk/source/gridsim/ResourceCharacteristics.java =================================================================== --- trunk/source/gridsim/ResourceCharacteristics.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResourceCharacteristics.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResourceCharacteristics.java,v 1.23 2007/08/20 02:14:24 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/ResourceUserList.java =================================================================== --- trunk/source/gridsim/ResourceUserList.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/ResourceUserList.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ResourceUserList.java,v 1.9 2004/11/01 02:52:37 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Sim_from_port.java =================================================================== --- trunk/source/gridsim/Sim_from_port.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Sim_from_port.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Sim_from_port.java,v 1.12 2005/04/01 06:20:43 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/SpaceShared.java =================================================================== --- trunk/source/gridsim/SpaceShared.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/SpaceShared.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: SpaceShared.java,v 1.28 2006/03/09 05:56:31 anthony Exp $ + * Copyright (c) 2003, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/Stat.java =================================================================== --- trunk/source/gridsim/Stat.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/Stat.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Stat.java,v 1.11 2004/11/01 02:52:37 anthony Exp $ + * Copyright (c) 2002, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/TimeShared.java =================================================================== --- trunk/source/gridsim/TimeShared.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/TimeShared.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: TimeShared.java,v 1.39 2006/03/09 05:56:32 anthony Exp $ + * Copyright (c) 2003, The University of Melbourne, Australia */ package gridsim; Modified: trunk/source/gridsim/auction/Auction.java =================================================================== --- trunk/source/gridsim/auction/Auction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/Auction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Auction.java,v 1.4 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/AuctionObserver.java =================================================================== --- trunk/source/gridsim/auction/AuctionObserver.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/AuctionObserver.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AuctionObserver.java,v 1.2 2006/03/20 04:15:00 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/AuctionTags.java =================================================================== --- trunk/source/gridsim/auction/AuctionTags.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/AuctionTags.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AuctionTags.java,v 1.1 2006/03/09 05:29:19 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/Auctioneer.java =================================================================== --- trunk/source/gridsim/auction/Auctioneer.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/Auctioneer.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Auctioneer.java,v 1.3 2006/03/22 00:50:59 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/ContinuousDoubleAuction.java =================================================================== --- trunk/source/gridsim/auction/ContinuousDoubleAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/ContinuousDoubleAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ContinuousDoubleAuction.java,v 1.2 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/DoubleAuction.java =================================================================== --- trunk/source/gridsim/auction/DoubleAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/DoubleAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: DoubleAuction.java,v 1.3 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/DutchAuction.java =================================================================== --- trunk/source/gridsim/auction/DutchAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/DutchAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: DutchAuction.java,v 1.3 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/EnglishAuction.java =================================================================== --- trunk/source/gridsim/auction/EnglishAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/EnglishAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: EnglishAuction.java,v 1.3 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java =================================================================== --- trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/FirstPriceSealedBidAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FirstPriceSealedBidAuction.java,v 1.2 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/Message.java =================================================================== --- trunk/source/gridsim/auction/Message.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/Message.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Message.java,v 1.3 2006/03/22 00:51:00 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; import java.util.Hashtable; Modified: trunk/source/gridsim/auction/MessageAsk.java =================================================================== --- trunk/source/gridsim/auction/MessageAsk.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageAsk.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageAsk.java,v 1.2 2006/03/20 04:15:00 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageBid.java =================================================================== --- trunk/source/gridsim/auction/MessageBid.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageBid.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageBid.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageCallForBids.java =================================================================== --- trunk/source/gridsim/auction/MessageCallForBids.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageCallForBids.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageCallForBids.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageInformOutcome.java =================================================================== --- trunk/source/gridsim/auction/MessageInformOutcome.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageInformOutcome.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageInformOutcome.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageInformStart.java =================================================================== --- trunk/source/gridsim/auction/MessageInformStart.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageInformStart.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageInformStart.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageRejectBid.java =================================================================== --- trunk/source/gridsim/auction/MessageRejectBid.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageRejectBid.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageRejectBid.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/MessageRejectCallForBid.java =================================================================== --- trunk/source/gridsim/auction/MessageRejectCallForBid.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/MessageRejectCallForBid.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: MessageRejectCallForBid.java,v 1.2 2006/03/20 04:15:01 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/OneSidedAuction.java =================================================================== --- trunk/source/gridsim/auction/OneSidedAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/OneSidedAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: OneSidedAuction.java,v 1.4 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/Responder.java =================================================================== --- trunk/source/gridsim/auction/Responder.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/Responder.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: Responder.java,v 1.1 2006/03/09 05:29:22 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/ReverseDutchAuction.java =================================================================== --- trunk/source/gridsim/auction/ReverseDutchAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/ReverseDutchAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ReverseDutchAuction.java,v 1.3 2006/03/23 03:40:56 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/ReverseEnglishAuction.java =================================================================== --- trunk/source/gridsim/auction/ReverseEnglishAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/ReverseEnglishAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ReverseEnglishAuction.java,v 1.4 2006/03/23 03:40:57 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.java =================================================================== --- trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/auction/ReverseFirstPriceSealedBidAuction.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: ReverseFirstPriceSealedBidAuction.java,v 1.2 2006/03/23 03:40:57 anthony Exp $ + * Copyright (c) 2006, The University of Melbourne, Australia */ package gridsim.auction; Modified: trunk/source/gridsim/datagrid/DataGridResource.java =================================================================== --- trunk/source/gridsim/datagrid/DataGridResource.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/DataGridResource.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; @@ -29,7 +31,7 @@ * more storage elements. It also performs registrations of files stored in * the resource to a designated RC. * <br><br> - * <ul><b>Local Replica Catalogue (RC):</b> This component is an optional part + * <li><b>Local Replica Catalogue (RC):</b> This component is an optional part * of a resource. The Local RC is responsible for indexing available files on * the resource only. It also handles users' queries. However, the Local RC * does not serve as a catalogue server to other resources. Modified: trunk/source/gridsim/datagrid/DataGridTags.java =================================================================== --- trunk/source/gridsim/datagrid/DataGridTags.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/DataGridTags.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/DataGridUser.java =================================================================== --- trunk/source/gridsim/datagrid/DataGridUser.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/DataGridUser.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/DataGridlet.java =================================================================== --- trunk/source/gridsim/datagrid/DataGridlet.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/DataGridlet.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid; import java.util.LinkedList; Modified: trunk/source/gridsim/datagrid/File.java =================================================================== --- trunk/source/gridsim/datagrid/File.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/File.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/FileAttribute.java =================================================================== --- trunk/source/gridsim/datagrid/FileAttribute.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/FileAttribute.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/ReplicaManager.java =================================================================== --- trunk/source/gridsim/datagrid/ReplicaManager.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/ReplicaManager.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/SimpleReplicaManager.java =================================================================== --- trunk/source/gridsim/datagrid/SimpleReplicaManager.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/SimpleReplicaManager.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid; Modified: trunk/source/gridsim/datagrid/filter/FileNameFilter.java =================================================================== --- trunk/source/gridsim/datagrid/filter/FileNameFilter.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/filter/FileNameFilter.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid.filter; Modified: trunk/source/gridsim/datagrid/filter/Filter.java =================================================================== --- trunk/source/gridsim/datagrid/filter/Filter.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/filter/Filter.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.filter; import gridsim.datagrid.FileAttribute; Modified: trunk/source/gridsim/datagrid/filter/FilterDataResult.java =================================================================== --- trunk/source/gridsim/datagrid/filter/FilterDataResult.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/filter/FilterDataResult.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,6 +3,8 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ package gridsim.datagrid.filter; Modified: trunk/source/gridsim/datagrid/index/AbstractRC.java =================================================================== --- trunk/source/gridsim/datagrid/index/AbstractRC.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/AbstractRC.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import eduni.simjava.*; Modified: trunk/source/gridsim/datagrid/index/DataGIS.java =================================================================== --- trunk/source/gridsim/datagrid/index/DataGIS.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/DataGIS.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import eduni.simjava.Sim_event; Modified: trunk/source/gridsim/datagrid/index/DataRegionalGIS.java =================================================================== --- trunk/source/gridsim/datagrid/index/DataRegionalGIS.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/DataRegionalGIS.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import eduni.simjava.*; Modified: trunk/source/gridsim/datagrid/index/RegionalRC.java =================================================================== --- trunk/source/gridsim/datagrid/index/RegionalRC.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/RegionalRC.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import java.util.*; Modified: trunk/source/gridsim/datagrid/index/TopRegionalRC.java =================================================================== --- trunk/source/gridsim/datagrid/index/TopRegionalRC.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/index/TopRegionalRC.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.index; import java.util.*; Modified: trunk/source/gridsim/datagrid/storage/HarddriveStorage.java =================================================================== --- trunk/source/gridsim/datagrid/storage/HarddriveStorage.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/storage/HarddriveStorage.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.storage; import gridsim.datagrid.File; Modified: trunk/source/gridsim/datagrid/storage/Storage.java =================================================================== --- trunk/source/gridsim/datagrid/storage/Storage.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/storage/Storage.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.storage; import gridsim.datagrid.File; Modified: trunk/source/gridsim/datagrid/storage/TapeStorage.java =================================================================== --- trunk/source/gridsim/datagrid/storage/TapeStorage.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/datagrid/storage/TapeStorage.java 2008-08-04 02:39:22 UTC (rev 198) @@ -3,7 +3,10 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2006, The University of Melbourne, Australia and + * University of Ljubljana, Slovenia */ + package gridsim.datagrid.storage; import gridsim.datagrid.File; Modified: trunk/source/gridsim/filter/FilterCreateAR.java =================================================================== --- trunk/source/gridsim/filter/FilterCreateAR.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/filter/FilterCreateAR.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FilterCreateAR.java,v 1.2 2005/03/10 04:35:17 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.filter; Modified: trunk/source/gridsim/filter/FilterGridlet.java =================================================================== --- trunk/source/gridsim/filter/FilterGridlet.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/filter/FilterGridlet.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FilterGridlet.java,v 1.3 2005/03/10 04:35:17 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.filter; Modified: trunk/source/gridsim/filter/FilterQueryTimeAR.java =================================================================== --- trunk/source/gridsim/filter/FilterQueryTimeAR.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/filter/FilterQueryTimeAR.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FilterQueryTimeAR.java,v 1.2 2005/03/10 04:35:17 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.filter; Modified: trunk/source/gridsim/filter/FilterResult.java =================================================================== --- trunk/source/gridsim/filter/FilterResult.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/filter/FilterResult.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: FilterResult.java,v 1.3 2005/03/10 04:35:17 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.filter; Modified: trunk/source/gridsim/index/AbstractGIS.java =================================================================== --- trunk/source/gridsim/index/AbstractGIS.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/index/AbstractGIS.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: AbstractGIS.java,v 1.8 2007/08/30 01:38:43 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.index; Modified: trunk/source/gridsim/index/RegionalGIS.java =================================================================== --- trunk/source/gridsim/index/RegionalGIS.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/index/RegionalGIS.java 2008-08-04 02:39:22 UTC (rev 198) @@ -4,7 +4,7 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * $Id: RegionalGIS.java,v 1.8 2006/01/17 01:30:24 anthony Exp $ + * Copyright (c) 2005, The University of Melbourne, Australia */ package gridsim.index; Modified: trunk/source/gridsim/net/FIFOScheduler.java =================================================================== --- trunk/source/gridsim/net/FIFOScheduler.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/net/FIFOScheduler.java 2008-08-04 02:39:22 UTC (rev 198) @@ -8,7 +8,8 @@ * August 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Copyright (c) 2004, The University of Melbourne, Australia and National + * University of Singapore * FIFOScheduler.java - Implements a First in First Out scheduler * */ Modified: trunk/source/gridsim/net/FloodAdPack.java =================================================================== --- trunk/source/gridsim/net/FloodAdPack.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/net/FloodAdPack.java 2008-08-04 02:39:22 UTC (rev 198) @@ -8,7 +8,8 @@ * September 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Copyright (c) 2004, The University of Melbourne, Australia and National + * University of Singapore * FloodAdPack.java - Used to send route advertisements * */ Modified: trunk/source/gridsim/net/FloodingRouter.java =================================================================== --- trunk/source/gridsim/net/FloodingRouter.java 2008-08-04 02:15:29 UTC (rev 197) +++ trunk/source/gridsim/net/FloodingRouter.java 2008-08-04 02:39:22 UTC (rev 198) @@ -8,7 +8,8 @@ * August 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Copyright (c) 2004, The University of Melbourne, Australia and National + * University of Singapore * FloodingRouter.java - Simulates a network router with Flooding as * the advertising protocol * @@ -43,7 +44,6 @@ private Hashtable routerTable; private Hashtable forwardTable; private int id; - private static final int BITS = 8; // 1 byte in bits /** @@ -342,10 +342,10 @@ if (sched.size() == 0) { if (numPackets == 1) { - nextTime = (pkt.getSize() * BITS) / sched.getBaudRate(); + nextTime = (pkt.getSize() * NetIO.BITS) / sched.getBaudRate(); } else { - nextTime = (MTU * BITS * 1.0) / sched.getBaudRate(); + nextTime = (MTU * NetIO.BITS * 1.0) / sched.getBaudRate(); } sendInternalEvent(nextTime, sched); @@ -368,14 +368,18 @@ pkt.getNetServiceType(), i+1, numPackets); np.setLast(id); - super.write("enqueing, " + np); + if (super.reportWriter_ != null) { + super.write("enqueing, " + np); + } sched.enque(np); // put the packet into the scheduler } // put the actual packet into the last one and resize it accordingly pkt.setLast(id); pkt.setSize(pkt.getSize() - MTU * (numPackets - 1)); - super.write("enqueing, " + pkt); + if (super.reportWriter_ != null) { + super.write("enqueing, " + pkt); + } sched.enque(pkt); // put the packet into the scheduler } @@ -519,7 +523,9 @@ ((InfoPacket) np).addExitTime( GridSim.clock() ); } - ... [truncated message content] |
From: <sul...@us...> - 2008-08-04 02:15:25
|
Revision: 197 http://gridsim.svn.sourceforge.net/gridsim/?rev=197&view=rev Author: sulistio Date: 2008-08-04 02:15:29 +0000 (Mon, 04 Aug 2008) Log Message: ----------- comment debugging statements Modified Paths: -------------- trunk/source/gridsim/net/flow/FilterFlow.java trunk/source/gridsim/net/flow/Flow.java trunk/source/gridsim/net/flow/FlowInput.java trunk/source/gridsim/net/flow/FlowLink.java trunk/source/gridsim/net/flow/FlowOutput.java trunk/source/gridsim/net/flow/FlowPacket.java trunk/source/gridsim/net/flow/FlowRouter.java Modified: trunk/source/gridsim/net/flow/FilterFlow.java =================================================================== --- trunk/source/gridsim/net/flow/FilterFlow.java 2008-08-03 07:00:02 UTC (rev 196) +++ trunk/source/gridsim/net/flow/FilterFlow.java 2008-08-04 02:15:29 UTC (rev 197) @@ -4,8 +4,8 @@ * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * + * Copyright (c) 2008, The University of Melbourne, Australia * Author: James Broberg - * */ package gridsim.net.flow; @@ -26,16 +26,14 @@ * (incoming buffer), or used to selectively wait for a future event. * <br> <br> * - * - * * @author James Broberg - * @since GridSim Toolkit 5.0 + * @since GridSim Toolkit 4.2 * @invariant $none */ public class FilterFlow extends Sim_predicate { private int tag_; // event tag to be matched - private int flowID_; // event or flow ID + private int flowID_; // event or flow ID /** Modified: trunk/source/gridsim/net/flow/Flow.java =================================================================== --- trunk/source/gridsim/net/flow/Flow.java 2008-08-03 07:00:02 UTC (rev 196) +++ trunk/source/gridsim/net/flow/Flow.java 2008-08-04 02:15:29 UTC (rev 197) @@ -1,14 +1,11 @@ /* - * ** Network and Service Differentiation Extensions to GridSim 4.0 ** + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * James Broberg - * - * August 2007 - * - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * Flow.java - Interface of a Network Flow. - * + * Copyright (c) 2008, The University of Melbourne, Australia + * Author: James Broberg */ package gridsim.net.flow; @@ -17,7 +14,7 @@ /** * This the structure for network flows. * - * @since GridSim Toolkit 4.0 + * @since GridSim Toolkit 4.2 * @author James Broberg, The University of Melbourne */ public interface Flow Modified: trunk/source/gridsim/net/flow/FlowInput.java =================================================================== --- trunk/source/gridsim/net/flow/FlowInput.java 2008-08-03 07:00:02 UTC (rev 196) +++ trunk/source/gridsim/net/flow/FlowInput.java 2008-08-04 02:15:29 UTC (rev 197) @@ -1,14 +1,11 @@ /* - * ** Network and Service Differentiation Extensions to GridSim 4.0 ** + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * + * Copyright (c) 2008, The University of Melbourne, Australia * Author: James Broberg (based on Input.java) - * - * March 2007 - * - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * FlowInput.java - Simulates a network input port - * */ package gridsim.net.flow; @@ -28,14 +25,14 @@ * <p> * It maintains an event queue * to serialize the data-in-flow and delivers to its parent entity. - * It accepts messages that comes from GridSim entities 'FlowOutput' entity - * and passes the same to the GridSim entity. + * It accepts event messages that comes from the 'FlowOutput' entity + * and passes the event data to the GridSim entity. * It simulates Network communication delay depending on current bottleneck Baud rate * and data length. Simultaneous inputs can be modeled using multiple * instances of this class. * * @author James Broberg - * @since GridSim Toolkit 5.0 + * @since GridSim Toolkit 4.2 * @invariant $none */ public class FlowInput extends Sim_entity implements NetIO @@ -43,10 +40,6 @@ private Sim_port inPort_; private Link link_; private double baudRate_; - private static final int BITS = 8; // 1 byte = 8 bits - private final int SIZE = 8; // 1 byte in bits - - private HashMap<Integer, Packet> activeFlows_; // stores a list of active Flows @@ -180,39 +173,42 @@ super.sim_get_next(ev); // get the next event in the queue obj = ev.get_data(); // get the incoming data + /**** NOTE: debugging System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag()); System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src()); - + *****/ + // if the simulation finishes then exit the loop if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) { break; // Check forecast of active flow and pass it onto Entity if still active } else if(ev.get_tag() == GridSimTags.FLOW_HOLD) { - System.out.println(super.get_name() + ".body(): checkForecast() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".body(): checkForecast() + at time = " + GridSim.clock()); checkForecast(ev); // Update flow duration forecast as a flow's bottleneck bandwidth has changed } else if (ev.get_tag() == GridSimTags.FLOW_UPDATE) { - System.out.println(super.get_name() + ".body(): updateForecast() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".body(): updateForecast() + at time = " + GridSim.clock()); updateForecast(ev); // if this entity is not connected in a network topology } else if (obj != null && obj instanceof IO_data) { - System.out.println(super.get_name() + ".body(): getDataFromEvent() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".body(): getDataFromEvent() + at time = " + GridSim.clock()); getDataFromEvent(ev); // if this entity belongs to a network topology } else if (obj != null && link_ != null) { - System.out.println(super.get_name() + ".body(): getDataFromLink() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".body(): getDataFromLink() + at time = " + GridSim.clock()); getDataFromLink(ev); } ev = null; // reset to null for gc to collect } - System.out.println(super.get_name() + ":%%%% Exiting body() at time " + - GridSim.clock() ); + //System.out.println(super.get_name() + ":%%%% Exiting body() at time " + + // GridSim.clock() ); } /** - * Check the forecast of a flow, and send data to output port if flow still exists + * Check the forecast of a flow, and send data to output port if flow + * still exists * * @param ev the flow hold notification event * @pre ev != null @@ -222,7 +218,7 @@ int pktID = (Integer) ev.get_data(); // ID of flow to be checked FlowPacket fp = null; // Reference to flow packet that needs forecast update - System.out.println(super.get_name() + ".checkForecast(): checking pkt id # " + pktID); + //System.out.println(super.get_name() + ".checkForecast(): checking pkt id # " + pktID); // If flow hasn't already finished, send it to inPort if ((fp = (FlowPacket) activeFlows_.get(pktID)) != null) { @@ -232,8 +228,8 @@ super.sim_schedule(inPort_, GridSimTags.SCHEDULE_NOW, fp.getTag() , io.getData()); activeFlows_.remove(pktID); - System.out.println(super.get_name() + ".checkForecast(): flow came from " + GridSim.getEntityName(fp.getSrcID()) - + " heading to " + GridSim.getEntityName(fp.getDestID())); + //System.out.println(super.get_name() + ".checkForecast(): flow came from " + GridSim.getEntityName(fp.getSrcID()) + // + " heading to " + GridSim.getEntityName(fp.getDestID())); // Deregister flow on all active links Iterator it = (fp.getLinks_()).iterator(); @@ -243,7 +239,7 @@ } } else { - System.out.println(super.get_name() + ".checkForecast(): pkt id # " + pktID + " already removed"); + //System.out.println(super.get_name() + ".checkForecast(): pkt id # " + pktID + " already removed"); } @@ -267,14 +263,14 @@ int sourceID = ev.get_src(); // ID of source of notification (FlowLink) int cancelledFlow = 0; // Count of canceled future events that match old forecast - System.out.println(super.get_name() + ".updateForecast(): updating pkt id # " + pktID); + //System.out.println(super.get_name() + ".updateForecast(): updating pkt id # " + pktID); // If flow hasn't already finished and been cleared... if ((fp = (FlowPacket) activeFlows_.get(pktID)) != null) { remSizeOld = fp.getRemSize(); bandwidthOld = fp.getBandwidth_(); - System.out.println(super.get_name() + "updateForecast(): rem size is " + remSizeOld + - "BW old is " + bandwidthOld + " last update " + fp.getUpdateTime()); + //System.out.println(super.get_name() + "updateForecast(): rem size is " + remSizeOld + + // "BW old is " + bandwidthOld + " last update " + fp.getUpdateTime()); Iterator it = (fp.getLinks_()).iterator(); // Find the source link of this notification and the associated bottleneck bandwidth @@ -286,20 +282,22 @@ } } - fp.setRemSize((long)((remSizeOld) - ((GridSim.clock()-fp.getUpdateTime())*(bandwidthOld/BITS)))); - duration = (fp.getRemSize()*BITS)/fp.getBandwidth_(); - System.out.println(super.get_name() + " new forecast end time is " + (GridSim.clock() + duration)); + fp.setRemSize((long)((remSizeOld) - ((GridSim.clock()-fp.getUpdateTime())*(bandwidthOld/NetIO.BITS)))); + duration = (fp.getRemSize()*NetIO.BITS)/fp.getBandwidth_(); + //System.out.println(super.get_name() + " new forecast end time is " + (GridSim.clock() + duration)); // Find old forecast and delete it! FilterFlow filter = new FilterFlow(fp.getID(), GridSimTags.FLOW_HOLD); cancelledFlow = this.sim_cancel(filter, null); + /**** // debugging if (cancelledFlow != 0) { System.out.println(super.get_name() + ".updateForecast(): old forecast cancelled #matches " + cancelledFlow); } + ******/ - System.out.println(super.get_name() + " setting updated forecast for packet #" + fp.getID()); + //System.out.println(super.get_name() + " setting updated forecast for packet #" + fp.getID()); // Make a note of the time when this forecast update was performed fp.setUpdateTime(GridSim.clock()); // Set new future event with the correct finish time @@ -368,7 +366,7 @@ // So, convert io into bits double minBaudRate = Math.min(baudRate_, senderBaudRate); double communicationDelay = GridSimRandom.realIO( - (io.getByteSize() * BITS) / minBaudRate); + (io.getByteSize() * NetIO.BITS) / minBaudRate); // NOTE: Below is a deprecated method for SimJava 2 //super.sim_hold(communicationDelay); @@ -411,7 +409,7 @@ { FlowPacket np = (FlowPacket) pkt; int tag = np.getTag(); - System.out.println("Packet id is " + np.getID()); + //System.out.println("Packet id is " + np.getID()); // ignore incoming junk packets if (tag == GridSimTags.JUNK_PKT) { @@ -423,8 +421,8 @@ return; } - System.out.println(super.get_name() + ".getDataFromLink() Time now " + GridSim.clock() - + " bottleneck is " + np.getBandwidth_() + " sum lat is " + np.getLatency() ); + //System.out.println(super.get_name() + ".getDataFromLink() Time now " + GridSim.clock() + // + " bottleneck is " + np.getBandwidth_() + " sum lat is " + np.getLatency() ); // if flow terminates at next entity, add to active flows // & hold for appropriate duration @@ -433,11 +431,11 @@ || pkt.getTag() == GridSimTags.JUNK_PKT) { np.setStartTime(GridSim.clock()); np.setUpdateTime(GridSim.clock()); - duration = np.getSize()*SIZE / np.getBandwidth_(); + duration = np.getSize()*NetIO.BITS / np.getBandwidth_(); activeFlows_.put(pkt.getID(), pkt); super.sim_schedule(super.get_id(), duration, GridSimTags.FLOW_HOLD, new Integer(pkt.getID())); - System.out.println(super.get_name() + ".getDataFromLink() initial forecast flow end at " + (GridSim.clock() - + duration)); + //System.out.println(super.get_name() + ".getDataFromLink() initial forecast flow end at " + (GridSim.clock() + // + duration)); return; } Modified: trunk/source/gridsim/net/flow/FlowLink.java =================================================================== --- trunk/source/gridsim/net/flow/FlowLink.java 2008-08-03 07:00:02 UTC (rev 196) +++ trunk/source/gridsim/net/flow/FlowLink.java 2008-08-04 02:15:29 UTC (rev 197) @@ -1,14 +1,11 @@ /* - * ** Network and Service Differentiation Extensions to GridSim 4.0 ** + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * + * Copyright (c) 2008, The University of Melbourne, Australia * Author: James Broberg - * - * March 2007 - * - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * FlowLink.java - Simulates a network link with active flows (based on SimpleLink.java) - * */ package gridsim.net.flow; @@ -27,7 +24,7 @@ * on SimpleLink.java by Gokul Poduval & Chen-Khong Tham * * @invariant $none - * @since GridSim Toolkit 5.0 + * @since GridSim Toolkit 4.2 * @author James Broberg, The University of Melbourne */ @@ -77,28 +74,6 @@ } /** - * Constructs a link with some default parameters. It simulates a link with - * a default value of baud rate, propagation delay and MTU. - * - * @param name Name of this Link - * @throws NullPointerException This happens when name is empty or null - * @throws ParameterException This happens when the given name is empty - * @see gridsim.net.Link#DEFAULT_BAUD_RATE - * @see gridsim.net.Link#DEFAULT_PROP_DELAY - * @see gridsim.net.Link#DEFAULT_MTU - * @pre name != null - * @post $none - */ -/* public FlowLink(String name) throws ParameterException, - NullPointerException - { - super(name, Link.DEFAULT_BAUD_RATE, Link.DEFAULT_PROP_DELAY, - Link.DEFAULT_MTU); - - init(); - }*/ - - /** * Initialises all attributes * @pre $none * @post $none @@ -214,8 +189,8 @@ { super.sim_get_next(ev); - System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag()); - System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src()); + //System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag()); + //System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src()); // if the simulation finishes then exit the loop if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) { @@ -223,7 +198,7 @@ } // process the received event - System.out.println(super.get_name() + ".body(): processEvent() at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".body(): processEvent() at time = " + GridSim.clock()); processEvent(ev); sim_completed(ev); } @@ -231,12 +206,12 @@ while(sim_waiting() > 0) { // wait for event and ignore - System.out.println(super.get_name() + ".body(): Ignore !!"); + //System.out.println(super.get_name() + ".body(): Ignore !!"); sim_get_next(ev); } - System.out.println(super.get_name() + ":%%%% Exiting body() at time " + - GridSim.clock() ); + //System.out.println(super.get_name() + ":%%%% Exiting body() at time " + + // GridSim.clock() ); } /** @@ -251,12 +226,12 @@ { case GridSimTags.PKT_FORWARD: // for normal packets case GridSimTags.JUNK_PKT: // for background traffic - System.out.println(super.get_name() + ".processEvent(): enque() at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".processEvent(): enque() at time = " + GridSim.clock()); enque(ev); break; case GridSimTags.INSIGNIFICANT: - System.out.println(super.get_name() + ".processEvent(): processInternalEvent() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".processEvent(): processInternalEvent() + at time = " + GridSim.clock()); processInternalEvent(); break; @@ -276,14 +251,14 @@ */ private synchronized boolean sendInternalEvent(double time) { - System.out.println(super.get_name() + " sendInternalEvent(): called at time = " + GridSim.clock()); + //System.out.println(super.get_name() + " sendInternalEvent(): called at time = " + GridSim.clock()); if (time < 0.0) { - System.out.println(super.get_name() + " sendInternalEvent(): false at time = " + GridSim.clock()); + //System.out.println(super.get_name() + " sendInternalEvent(): false at time = " + GridSim.clock()); return false; } - System.out.println(super.get_name() + " sendInternalEvent(): scheduled for = " + time + " from now"); + //System.out.println(super.get_name() + " sendInternalEvent(): scheduled for = " + time + " from now"); super.sim_schedule(super.get_id(), time, GridSimTags.INSIGNIFICANT); return true; } @@ -296,7 +271,7 @@ private synchronized void processInternalEvent() { - System.out.println(super.get_name() + "processInternalEvent(): " + GridSim.clock()); + //System.out.println(super.get_name() + "processInternalEvent(): " + GridSim.clock()); // this is a constraint that prevents an infinite loop // Compare between 2 floating point numbers. This might be incorrect @@ -320,8 +295,8 @@ } - System.out.println("Super.delay_ is " + super.delay_); - System.out.println(super.get_name() + " processInternalEvent(): done at time = " + GridSim.clock()); + //System.out.println("Super.delay_ is " + super.delay_); + //System.out.println(super.get_name() + " processInternalEvent(): done at time = " + GridSim.clock()); } /** @@ -332,7 +307,7 @@ */ private synchronized void enque(Sim_event ev) { - System.out.println(super.get_name() + " enque() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + " enque() + at time = " + GridSim.clock()); int tag = ((Packet)ev.get_data()).getTag(); // Register passing flow, gridlet or junk as active on this link if (tag == GridSimTags.FLOW_SUBMIT || tag == GridSimTags.GRIDLET_SUBMIT || @@ -358,13 +333,13 @@ private synchronized void deque(Packet np) { - System.out.println(super.get_name() + ".deque() for packet " + np.getID() +" here"); - System.out.println(super.get_name() + ".deque() packet " + np.toString()); + //System.out.println(super.get_name() + ".deque() for packet " + np.getID() +" here"); + //System.out.println(super.get_name() + ".deque() packet " + np.toString()); int dest = getNextHop(np); if (dest == -1) { - System.out.println(super.get_name() + ".deque() here3"); + //System.out.println(super.get_name() + ".deque() here3"); return; } @@ -372,7 +347,7 @@ int tag = 0; if (dest == outEnd2_ || dest == outEnd1_) { - System.out.println(super.get_name() + ".deque() here1"); + //System.out.println(super.get_name() + ".deque() here1"); // for junk packets only if (np.getTag() == GridSimTags.JUNK_PKT) { @@ -385,14 +360,14 @@ } // other side is a GridSim entity else { - System.out.println(super.get_name() + ".deque() here2"); + //System.out.println(super.get_name() + ".deque() here2"); tag = np.getTag(); } // sends the packet super.sim_schedule(dest, GridSimTags.SCHEDULE_NOW, tag, np); - System.out.println(super.get_name() + ".deque() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".deque() + at time = " + GridSim.clock()); } @@ -437,8 +412,8 @@ // Add flow to link activeFlows_.put(np.getID(), np ); - System.out.println(super.get_name() + ".registerFlow(): registering flow #" + np.getID() - + " total of " + activeFlows_.size() + " flows"); + //System.out.println(super.get_name() + ".registerFlow(): registering flow #" + np.getID() + // + " total of " + activeFlows_.size() + " flows"); // Register link to flow ((FlowPacket)np).addLink(this); @@ -450,11 +425,11 @@ // If change in bandwidth affects an existing flow i.e. is < current bottleneck if (this.getBaudRate() < tempFlow.getBandwidth_() && tempFlow.getID() != np.getID()) { // Need to notify flow - System.out.println(super.get_name() + ".registerFlow(): flow #" + np.getID() - + " bottleneck now " + this.getBaudRate() + " at time " + GridSim.clock()); + //System.out.println(super.get_name() + ".registerFlow(): flow #" + np.getID() + // + " bottleneck now " + this.getBaudRate() + " at time " + GridSim.clock()); // I can notify directly as I know the destId's!!!! - System.out.println(super.get_name() + ".registerFlow(): updating flow #" + tempFlow.getID() - + " destination " + tempFlow.getDestID()); + //System.out.println(super.get_name() + ".registerFlow(): updating flow #" + tempFlow.getID() + // + " destination " + tempFlow.getDestID()); super.sim_schedule(GridSim.getEntityId("Input_" + GridSim.getEntityName(tempFlow.getDestID())), GridSimTags.SCHEDULE_NOW, GridSimTags.FLOW_UPDATE, new Integer(tempFlow.getID())); @@ -476,8 +451,8 @@ // If the flow hasn't been removed already, remove from active flow list if ((fp = (FlowPacket) activeFlows_.remove(np.getID())) != null) { - System.out.println(super.get_name() + ".deregisterFlow() success flow # " + np.getID() - + " " + fp.getBandwidth_()); + //System.out.println(super.get_name() + ".deregisterFlow() success flow # " + np.getID() + // + " " + fp.getBandwidth_()); // Check if this affects any existing flows Iterator<Integer> flowsIter = activeFlows_.keySet().iterator(); @@ -488,11 +463,11 @@ if (this.getBaudRate() > tempFlow.getBandwidth_() && tempFlow.getID() != np.getID() && tempFlow.getBottleneckID() == this.get_id()) { // Need to notify flow - System.out.println(super.get_name() + ".deregisterFlow(): flow #" + np.getID() - + " bottleneck now " + this.getBaudRate() + " at time " + GridSim.clock()); + //System.out.println(super.get_name() + ".deregisterFlow(): flow #" + np.getID() + // + " bottleneck now " + this.getBaudRate() + " at time " + GridSim.clock()); // I can notify directly as I know the destId's!!!! - System.out.println(super.get_name() + ".deregisterFlow(): updating flow #" + tempFlow.getID() - + " destination " + tempFlow.getDestID()); + //System.out.println(super.get_name() + ".deregisterFlow(): updating flow #" + tempFlow.getID() + // + " destination " + tempFlow.getDestID()); super.sim_schedule(GridSim.getEntityId("Input_" + GridSim.getEntityName(tempFlow.getDestID())), GridSimTags.SCHEDULE_NOW, GridSimTags.FLOW_UPDATE, new Integer(tempFlow.getID())); @@ -510,10 +485,10 @@ */ public synchronized double getBaudRate() { if (activeFlows_.size() != 0) { - System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)/(activeFlows_.size())); + //System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)/(activeFlows_.size())); return (super.baudRate_)/(activeFlows_.size()); } else { - System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)); + //System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)); return super.baudRate_; } Modified: trunk/source/gridsim/net/flow/FlowOutput.java =================================================================== --- trunk/source/gridsim/net/flow/FlowOutput.java 2008-08-03 07:00:02 UTC (rev 196) +++ trunk/source/gridsim/net/flow/FlowOutput.java 2008-08-04 02:15:29 UTC (rev 197) @@ -1,14 +1,11 @@ /* - * ** Network and Service Differentiation Extensions to GridSim 4.0 ** + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * Author: James Broberg - * - * March 2007 - * - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * FlowOutput.java - Simulates a network output port - * + * Copyright (c) 2008, The University of Melbourne, Australia + * Author: James Broberg (based on Output.java) */ package gridsim.net.flow; @@ -34,7 +31,7 @@ * instances of this class * * @author James Broberg - * @since GridSim Toolkit 5.0 + * @since GridSim Toolkit 4.2 * @invariant $none */ public class FlowOutput extends Sim_entity implements NetIO @@ -49,7 +46,6 @@ private TrafficGenerator gen_; // background traffic generator private ArrayList list_; // list of resources + user entities private boolean hasStarted_; // a flag for background traffic has started - private static final int BITS = 8; // 1 byte = 8 bits private Random rnd; // Random number generator to generate unique // flow ID's @@ -267,8 +263,8 @@ break; } - System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag()); - System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src()); + //System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag()); + //System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src()); // handle different types of incoming events switch ( ev.get_tag() ) @@ -441,7 +437,7 @@ if (link_ != null && destId != gisID && destId != statID && destId != shutdownID) { - System.out.println(super.get_name() + ".defaultSend(): submitToLink() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + ".defaultSend(): submitToLink() + at time = " + GridSim.clock()); submitToLink(ev); return; } @@ -461,7 +457,7 @@ // So, convert io into bits double minBaudRate = Math.min(baudRate_, receiverBaudRate); double communicationDelay = GridSimRandom.realIO( - (io.getByteSize() * BITS) / minBaudRate); + (io.getByteSize() * NetIO.BITS) / minBaudRate); // NOTE: Below is a deprecated method for SimJava 2 //super.sim_hold(communicationDelay); @@ -493,7 +489,7 @@ destId, netServiceType, 1, 1); - System.out.println("Sending flow packet to link at time = " + GridSim.clock() + " id is " + np.getID()); + //System.out.println("Sending flow packet to link at time = " + GridSim.clock() + " id is " + np.getID()); enque(np, GridSimTags.SCHEDULE_NOW); } @@ -620,15 +616,13 @@ */ private synchronized void enque(Packet pkt, double delay) { - - flowList_.add(pkt); if (flowList_.size() == 1) { - System.out.println(super.get_name() + ".enque() Size is " + pkt.getSize() + " baud " + link_.getBaudRate()); + //System.out.println(super.get_name() + ".enque() Size is " + pkt.getSize() + " baud " + link_.getBaudRate()); double total = 0.0; - System.out.println(super.get_name() + ".enque() Time now " + GridSim.clock() + " delay is " + total); + //System.out.println(super.get_name() + ".enque() Time now " + GridSim.clock() + " delay is " + total); super.sim_schedule(super.get_id(), total, GridSimTags.SEND_PACKET); } @@ -664,7 +658,7 @@ // if an entity tries to send a packet to itself if ( np.getDestID() == outPort_.get_dest() ) { - System.out.println("Sending packet to self!"); + //System.out.println("Sending packet to self!"); // then change the destination name and id String destName = super.get_name(); destName = destName.replaceFirst("Output", "Input"); Modified: trunk/source/gridsim/net/flow/FlowPacket.java =================================================================== --- trunk/source/gridsim/net/flow/FlowPacket.java 2008-08-03 07:00:02 UTC (rev 196) +++ trunk/source/gridsim/net/flow/FlowPacket.java 2008-08-04 02:15:29 UTC (rev 197) @@ -1,12 +1,11 @@ /* - * ** Network and Service Differentiation Extensions to GridSim 3.0 ** + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * + * Copyright (c) 2008, The University of Melbourne, Australia * Author: James Broberg - * - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * FlowPacket.java - Implementation of a Flow Packet. - * */ package gridsim.net.flow; @@ -22,7 +21,7 @@ * Structure of a packet used to encapsulate flow passing through the network. * * @invariant $none - * @since GridSim Toolkit 5.0 + * @since GridSim Toolkit 4.2 * @author James Broberg */ public class FlowPacket implements Packet @@ -570,6 +569,12 @@ this.srcID = srcID; } + /** + * Sets the tag of this packet + * @param tag the packet's tag + * @pre $none + * @post $none + */ public void setTag(int tag) { this.tag = tag; } Modified: trunk/source/gridsim/net/flow/FlowRouter.java =================================================================== --- trunk/source/gridsim/net/flow/FlowRouter.java 2008-08-03 07:00:02 UTC (rev 196) +++ trunk/source/gridsim/net/flow/FlowRouter.java 2008-08-04 02:15:29 UTC (rev 197) @@ -1,20 +1,14 @@ /* - * ** Network and Service Differentiation Extensions to GridSim 5.0 ** + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * Author: James Broberg - * + * Copyright (c) 2008, The University of Melbourne, Australia + * Author: James Broberg * Author: Gokul Poduval & Chen-Khong Tham - * Computer Communication Networks (CCN) Lab - * Dept of Electrical & Computer Engineering - * National University of Singapore - * August 2004 - * - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * - * FlowRouter.java - Simulates a flow network router with RIP as the advertising - * protocol (adapted from RIPRouter.java) - * */ + package gridsim.net.flow; import eduni.simjava.*; @@ -25,8 +19,8 @@ /** - * This class implements a FlowRouter using a form of RIP for routing. The routing - * protocol used here is similar to <a + * This class implements a FlowRouter using a form of RIP for routing. + * The routing protocol used here is similar to <a * href="http://www.ietf.org/rfc/rfc1058.txt">Routing Information Protocol * (RIP) </a>. The routing protocol is run before Gridlets etc. can be * submitted. @@ -37,7 +31,7 @@ * reliable protocol to use. * * @invariant $none - * @since GridSim Toolkit 5.0 + * @since GridSim Toolkit 4.2 * @author James Broberg, The University of Melbourne * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore */ @@ -49,11 +43,10 @@ private Hashtable routerTable; private Hashtable forwardTable; private int id; - private static final int BITS = 8; // 1 byte in bits /** - * Creates a new FlowRouter object. + * Creates a new FlowRouter object. * By default, <b>no recording or logging</b> * is done for packets' activities. If you want to log operations of this * entity, please use {@link #FlowRouter(String, boolean)}. @@ -278,17 +271,22 @@ */ protected synchronized void processEvent(Sim_event ev) { - - System.out.println(super.get_name() + ".processEvent(): Event was scheduled for " + ev.event_time()); - System.out.println(super.get_name() + ".processEvent(): ev.get_tag() is " + ev.get_tag()); - System.out.println(super.get_name() + ".processEvent(): ev.get_src() is " + ev.get_src()); + /***** NOTE: debugging information + System.out.println(super.get_name() + + ".processEvent(): Event was scheduled for " + ev.event_time()); + System.out.println(super.get_name() + + ".processEvent(): ev.get_tag() is " + ev.get_tag()); + System.out.println(super.get_name() + + ".processEvent(): ev.get_src() is " + ev.get_src()); + *************/ switch ( ev.get_tag() ) { - + case GridSimTags.PKT_FORWARD: case GridSimTags.JUNK_PKT: - System.out.println(super.get_name() + ".processEvent(): processNetPacket() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + + // ".processEvent(): processNetPacket() + at time = " + GridSim.clock()); processFlowPacket(ev, ev.get_tag()); break; @@ -297,7 +295,8 @@ break; case GridSimTags.INSIGNIFICANT: - System.out.println(super.get_name() + ".processEvent(): processInternalEvent() + at time = " + GridSim.clock()); + //System.out.println(super.get_name() + + // ".processEvent(): processInternalEvent() + at time = " + GridSim.clock()); processInternalEvent(ev); break; @@ -318,10 +317,9 @@ */ private synchronized void processFlowPacket(Sim_event ev, int tag) { - //double nextTime = 0; Packet pkt = (Packet) ev.get_data(); PacketScheduler sched = getScheduler(pkt); - System.out.println("Packet id is " + pkt.getID()); + //System.out.println("Packet id is " + pkt.getID()); // if a packet scheduler is not found, then try reschedule this packet // in the future @@ -342,42 +340,50 @@ ((InfoPacket) pkt).addEntryTime( GridSim.clock() ); ((InfoPacket) pkt).addBaudRate(sched.getBaudRate()); } - - System.out.println(super.get_name() + ".processNetPacket() check sched Time now " + GridSim.clock()); + + //System.out.println(super.get_name() + + // ".processNetPacket() check sched Time now " + GridSim.clock()); + // if no packets at the moment if (sched.size() == 0) { - System.out.println(super.get_name() + ".processNetPacket() #packets " + - " size " + pkt.getSize()*BITS + " baud sched " + sched.getBaudRate() + - " largest double " + Double.MAX_VALUE); + /****** // NOTE: debugging information + System.out.println(super.get_name() + ".processNetPacket() #packets " + + " size " + pkt.getSize()*NetIO.BITS + " baud sched " + + sched.getBaudRate() + " largest double " + Double.MAX_VALUE); - - System.out.println(super.get_name() + ".processNetPacket() set internal event to " + - "fire"); - // Fire internal event without delay (delay is incurred entirely at source - // of Flow + System.out.println(super.get_name() + + ".processNetPacket() set internal event to fire"); + ******/ + + // Fire internal event without delay (delay is incurred entirely at + // source of Flow sendInternalEvent(GridSimTags.SCHEDULE_NOW, sched); } - System.out.println(super.get_name() + ".processNetPacket() done sched Time now " + - GridSim.clock()); + //System.out.println(super.get_name() + + // ".processNetPacket() done sched Time now " + GridSim.clock()); + // log / record .... if (super.reportWriter_ != null) { super.write(""); super.write("receive incoming, " + pkt + ", delay, " + 0.0); - //super.write("break this packet into, " + numPackets); } // put the actual packet into the last one and resize it accordingly pkt.setLast(id); pkt.setSize(pkt.getSize()); - super.write("enqueing, " + pkt); + + if (super.reportWriter_ != null) { + super.write("enqueing, " + pkt); + } + sched.enque(pkt); // put the packet into the scheduler } - + /** * Gets the link's name for a given id * @param destID a destination id @@ -518,7 +524,9 @@ ((InfoPacket) np).addExitTime( GridSim.clock() ); } - super.write("dequeuing, " + np); + if (super.reportWriter_ != null) { + super.write("dequeuing, " + np); + } // must distinguish between normal and junk packet int tag = GridSimTags.PKT_FORWARD; @@ -531,12 +539,12 @@ super.sim_schedule(GridSim.getEntityId(linkName), GridSimTags.SCHEDULE_NOW, tag, np); - System.out.println(super.get_name() + ".deque() time now " + GridSim.clock()); + //System.out.println(super.get_name() + ".deque() time now " + GridSim.clock()); // process the next packet in the scheduler if ( !sched.isEmpty() ) { - double nextTime = (np.getSize() * BITS) / sched.getBaudRate(); + double nextTime = (np.getSize() * NetIO.BITS) / sched.getBaudRate(); sendInternalEvent(nextTime, sched); } } @@ -608,7 +616,11 @@ { RIPAdPack ad = new RIPAdPack(super.get_name(), hosts); String router = (String) routers.nextElement(); - super.write("advertise to router, " + router); + + if (super.reportWriter_ != null) { + super.write("advertise to router, " + router); + } + sim_schedule(Sim_system.get_entity_id(router), GridSimTags.SCHEDULE_NOW, GridSimTags.ROUTER_AD, ad); } @@ -626,7 +638,10 @@ */ private synchronized void receiveAd(Sim_event ev) { - super.write("receive router ad from, "+GridSim.getEntityName(ev.get_src())); + if (super.reportWriter_ != null) { + super.write("receive router ad from, " + + GridSim.getEntityName(ev.get_src())); + } // what to do when an ad is received RIPAdPack ad = (RIPAdPack)ev.get_data(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-08-03 06:59:55
|
Revision: 196 http://gridsim.svn.sourceforge.net/gridsim/?rev=196&view=rev Author: sulistio Date: 2008-08-03 07:00:02 +0000 (Sun, 03 Aug 2008) Log Message: ----------- add new methods to incorporate creating new flow routers and links. Modified Paths: -------------- trunk/source/gridsim/util/NetworkReader.java Modified: trunk/source/gridsim/util/NetworkReader.java =================================================================== --- trunk/source/gridsim/util/NetworkReader.java 2008-08-03 06:00:43 UTC (rev 195) +++ trunk/source/gridsim/util/NetworkReader.java 2008-08-03 07:00:02 UTC (rev 196) @@ -7,6 +7,7 @@ package gridsim.util; +import gridsim.net.flow.*; import gridsim.net.*; import java.util.*; import java.io.*; @@ -32,7 +33,7 @@ * ... // linking other routers<br> * </tt> * <br> - * NOTE: <tt>[]</tt> means an optional parameter for logging activities + * NOTE: <tt>[]</tt> means an optional parameter for logging activities * inside a router. * If it is not given, then by default the value is false. * @@ -41,6 +42,11 @@ */ public class NetworkReader { + private static final int RATE_ROUTER = 1; + private static final int RIP_ROUTER = 2; + private static final int FLOOD_ROUTER = 3; + private static final int FLOW_ROUTER = 4; + /** * Creates a network topology that uses a FIFO packet scheduler * @param filename the name of the file containing the description of @@ -188,7 +194,7 @@ * @return a list of Router objects or <tt>null</tt> if an error occurs */ private static LinkedList createRouter(BufferedReader buf, - boolean rate) throws Exception + int routerType) throws Exception { String line = null; StringTokenizer str = null; @@ -249,12 +255,19 @@ } // create a specific Router object - if (rate == true) { + if (routerType == RATE_ROUTER) { router = new RateControlledRouter(name, log); } - else { + else if (routerType == RIP_ROUTER) { router = new RIPRouter(name, log); } + else if (routerType == FLOOD_ROUTER) { + router = new FloodingRouter(name, log); + } + else if (routerType == FLOW_ROUTER) { + router = new FlowRouter(name, log); + } + routerList.add(router); // add the router into the list } @@ -274,7 +287,7 @@ } // create the Router objects first - LinkedList routerList = createRouter(buf, false); + LinkedList routerList = createRouter(buf, NetworkReader.RIP_ROUTER); int GB = 1000000000; // 1 GB in bits String line; @@ -345,7 +358,7 @@ } // create the Router objects first - LinkedList routerList = createRouter(buf, false); + LinkedList routerList = createRouter(buf, NetworkReader.RIP_ROUTER); int GB = 1000000000; // 1 GB in bits String line; @@ -417,7 +430,7 @@ } // create the Router objects first - LinkedList routerList = createRouter(buf, true); + LinkedList routerList = createRouter(buf, NetworkReader.RATE_ROUTER); int GB = 1000000000; // 1 GB in bits String line; @@ -482,5 +495,101 @@ return routerList; } + /** + * Creates a network topology that uses the flow network functionality. + * @param filename the name of the file containing the description of + * the network topology + * @return the list of Routers of the network or <tt>null</tt> if an error + * occurs + * @see gridsim.net.flow.FlowRouter + * @see gridsim.net.flow.FlowLink + */ + public static LinkedList createFlow(String filename) + { + LinkedList routerList = null; + try + { + FileReader fileReader = new FileReader(filename); + BufferedReader buffer = new BufferedReader(fileReader); + routerList = createNetworkFlow(buffer); + } + catch (Exception exp) + { + System.out.println("NetworkReader: File not found."); + routerList = null; + } + + return routerList; + } + + /** + * Creates a network topology from a given buffered reader + * @param buf a Buffered Reader object + * @return a list of Router objects or <tt>null</tt> if an error occurs + */ + private static LinkedList createNetworkFlow(BufferedReader buf) + throws Exception + { + if (buf == null) { + return null; + } + + // create the Router objects first + LinkedList routerList = createRouter(buf, NetworkReader.FLOW_ROUTER); + + int GB = 1000000000; // 1 GB in bits + String line; + String name1, name2; + StringTokenizer str = null; + Router r1, r2; + Link tempLink = null; + + // creating the linking between two routers + while ((line = buf.readLine()) != null) + { + str = new StringTokenizer(line); + if (str.hasMoreTokens() == false) { // ignore newlines + continue; + } + + + // parse the name of the connected routers + name1 = str.nextToken(); // router name + if (name1.startsWith("#") == true) { // ignore comments + continue; + } + + name2 = str.nextToken(); // router name + r1 = getRouter(name1, routerList); + r2 = getRouter(name2, routerList); + + if (r1 == null || r2 == null) + { + System.out.println("NetworkReader.createNetworkFlow(): " + + "Warning - unable to connect both "+name1+" and "+name2); + continue; + } + + // get baud rate of the link + String baud = str.nextToken(); // bandwidth (Gbps) + String propDelay = str.nextToken(); // latency (in millisec) + String mtu = str.nextToken(); // link MTU (in byte) + + tempLink = new FlowLink(r1.get_name() + "_" + r2.get_name(), + Double.parseDouble(baud) * GB, + Double.parseDouble(propDelay), Integer.parseInt(mtu)); + + FIFOScheduler r1Sched = new FIFOScheduler(r1.get_name() + + "_to_" + r2.get_name()); + + FIFOScheduler r2Sched = new FIFOScheduler(r2.get_name() + + "_to_" + r1.get_name()); + + r1.attachRouter(r2, tempLink, r1Sched, r2Sched); + } + + return routerList; + } + } // end class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-08-03 06:00:34
|
Revision: 195 http://gridsim.svn.sourceforge.net/gridsim/?rev=195&view=rev Author: sulistio Date: 2008-08-03 06:00:43 +0000 (Sun, 03 Aug 2008) Log Message: ----------- modify this class to incorporate the latest network flow functionality into GridSim. Modified Paths: -------------- trunk/source/gridsim/GridSim.java trunk/source/gridsim/GridSimCore.java trunk/source/gridsim/GridSimTags.java trunk/source/gridsim/net/Input.java trunk/source/gridsim/net/Link.java trunk/source/gridsim/net/Output.java trunk/source/gridsim/net/Packet.java Modified: trunk/source/gridsim/GridSim.java =================================================================== --- trunk/source/gridsim/GridSim.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/GridSim.java 2008-08-03 06:00:43 UTC (rev 195) @@ -9,13 +9,13 @@ package gridsim; +//import gridsim.net.fnb.FnbWhiteList; import gridsim.net.Link; import gridsim.filter.*; import java.io.*; import java.util.*; import eduni.simjava.*; - /** * This class is mainly responsible in initialization, running and stopping of * the overall simulation. @@ -71,7 +71,7 @@ private final int ARRAY_SIZE = 3; private final int SIZE = 12; // Integer object size incl. overhead private final int RESULT = 1; // array[0] = gridlet id, [1] = result - private final static String GRIDSIM_VERSION_STRING = "GridSim Version 4.1"; + private final static String GRIDSIM_VERSION_STRING = "4.2"; /////////////////////////// STATIC variables //////////////////// @@ -98,13 +98,21 @@ */ public static int PAUSE = 10; // pause before registering to regional GIS + /** + * A white list that records entity IDs. + * The main purpose is that network packets are not going to be dropped, + * if they are going to/coming from the entity stored in the list. + * @see gridsim.net.fnb.FnbWhiteList + */ + //public static FnbWhiteList fnbWhiteList_ = null; // TODO + private static int gisID_ = -1; // id of GIS entity private static int shutdownID_ = -1; // id of GridSimShutdown entity private static int statsID_ = -1; // id of GridStatistics entity private static Calendar calendar_ = null; // a Calendar object private static GridInformationService gis_ = null; // a GIS object private final static int NOT_FOUND = -1; // a constant - private static boolean traceFlag_; + private static boolean traceFlag_ = false; // trace events or other activities //////////////////////////////////////////////////////////////////////// @@ -544,7 +552,7 @@ Sim_system.initialise(); Sim_system.set_trc_level(1); Sim_system.set_auto_trace(traceFlag); - + traceFlag_ = traceFlag; // Set the current Wall clock time as the starting time of simulation @@ -601,7 +609,7 @@ */ public static void startGridSimulation() throws NullPointerException { - System.out.println("Starting GridSim " + GRIDSIM_VERSION_STRING); + System.out.println("Starting GridSim version " + GRIDSIM_VERSION_STRING); try { Sim_system.run(); } @@ -2135,10 +2143,10 @@ return GridSim.isResourceExist(id); } - + /** * Checks whether simulation's statistics of other log should be created - * @return <tt>true</tt> if the information should be logged + * @return <tt>true</tt> if the information should be logged * or <tt>false</tt> otherwise. */ public static boolean isTraceEnabled() { @@ -2501,5 +2509,56 @@ ); } + /** + * Initializes the {@link gridsim.GridSimCore#NETWORK_TYPE} to be used in + * the simulation. By default, the {@link gridsim.GridSimCore#NETWORK_TYPE} + * is set to {@link gridsim.GridSimTags.NET_PACKET_LEVEL}. + * + * @param networkType network type + * @return <tt>true</tt> if the network type has been initialized successfully + * or <tt>false</tt> otherwise. + * + * @see gridsim.GridSimCore#NETWORK_TYPE + * @see gridsim.GridSimTags.NET_PACKET_LEVEL + * @see gridsim.GridSimTags.NET_FLOW_LEVEL + * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + */ + public static boolean initNetworkType(int networkType) + { + boolean result = true; + switch(networkType) + { + case GridSimTags.NET_PACKET_LEVEL: + GridSimCore.NETWORK_TYPE = GridSimTags.NET_PACKET_LEVEL; + break; + + case GridSimTags.NET_FLOW_LEVEL: + GridSimCore.NETWORK_TYPE = GridSimTags.NET_FLOW_LEVEL; + break; + + case GridSimTags.NET_BUFFER_PACKET_LEVEL: + GridSimCore.NETWORK_TYPE = GridSimTags.NET_BUFFER_PACKET_LEVEL; + //fnbWhiteList_ = new FnbWhiteList(); // TODO + break; + + default: + result = false; + break; + } + + return result; + } + + /** Returns the network type used in this simulation. + * @return the network type + * @see gridsim.GridSimCore#NETWORK_TYPE + * @see gridsim.GridSimTags.NET_PACKET_LEVEL + * @see gridsim.GridSimTags.NET_FLOW_LEVEL + * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + */ + public static int getNetworkType() { + return GridSimCore.NETWORK_TYPE; + } + } // end class Modified: trunk/source/gridsim/GridSimCore.java =================================================================== --- trunk/source/gridsim/GridSimCore.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/GridSimCore.java 2008-08-03 06:00:43 UTC (rev 195) @@ -13,8 +13,9 @@ import gridsim.net.*; import gridsim.util.*; import java.util.Collection; +import gridsim.net.flow.*; +//import gridsim.net.fnb.*; - /** * Since GridSim version 3.0, this is the overall class of GridSim package, * that must be extended by other GridSim @@ -188,7 +189,19 @@ protected Sim_port output; // Output port but only for a network extension. - private Output out_ = null; + private NetIO out_ = null; + + /** Specifies which type of network to be used. + * By default, the simulation uses the gridsim.net package or differentiated + * network service. To change this default property, please use the + * {@link gridsim.GridSim#initNetworkType(int)} method <b>before</b> the + * simulation starts. + * @see gridsim.GridSim#initNetworkType(int) + * @see gridsim.GridSimTags.NET_PACKET_LEVEL + * @see gridsim.GridSimTags.NET_FLOW_LEVEL + * @see gridsim.GridSimTags.NET_BUFFER_PACKET_LEVEL + */ + protected static int NETWORK_TYPE = GridSimTags.NET_PACKET_LEVEL; /** @@ -253,13 +266,7 @@ super.add_port(input); super.add_port(output); - // Every GridSim entity with network has its own input/output channels. - // Connect this entity "input" port to its input buffer "in_port" - new Input("Input_" + name, baudRate); - Sim_system.link_ports(name, "input", "Input_" + name, "input_buffer"); - - new Output("Output_" + name, baudRate); - Sim_system.link_ports(name, "output", "Output_"+name, "output_buffer"); + initNetwork(name, baudRate, null); } /** @@ -274,7 +281,7 @@ * @param name the name to be associated with this entity (as * required by Sim_entity class from simjava package) * @param link the link that this GridSim entity will use to - communicate with other GridSim or Network entities. + * communicate with other GridSim or Network entities. * @throws Exception This happens when creating this entity before * initializing GridSim package or this entity name is * <tt>null</tt> or empty @@ -299,15 +306,49 @@ super.add_port(input); super.add_port(output); + initNetwork(name, link.getBaudRate(), link); + } + + /** + * Creates Input and Output entities according to the network type + * @param name the name to be associated with this entity (as + * required by Sim_entity class from simjava package) + * @param baudRate network communication or bandwidth speed + * @param link the link that this GridSim entity will use to + * communicate with other GridSim or Network entities. + */ + private void initNetwork(String name, double baudRate, Link link) + { // Every GridSim entity with network has its own input/output channels. // Connect this entity "input" port to its input buffer "in_port" - Input in = new Input("Input_" + name, link_.getBaudRate()); - in.addLink(link_); + NetIO in = null; + + // Packet Level networking + if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_PACKET_LEVEL) + { + in = new Input("Input_" + name, baudRate); + out_ = new Output("Output_" + name, baudRate); + } + // Flow Level networking + else if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_FLOW_LEVEL) + { + in = new FlowInput("Input_" + name, baudRate); + out_ = new FlowOutput("Output_" + name, baudRate); + } + // Use Finite network buffer + else if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_BUFFER_PACKET_LEVEL) + { // TODO: + //in = new FnbInput("Input_" + name, baudRate); + //out_ = new FnbOutput("Output_" + name, baudRate); + } + Sim_system.link_ports(name, "input", "Input_" + name, "input_buffer"); - - out_ = new Output("Output_" + name, link_.getBaudRate()); - out_.addLink(link_); - Sim_system.link_ports(name, "output", "Output_"+name, "output_buffer"); + Sim_system.link_ports(name, "output", "Output_" + name, "output_buffer"); + if (link != null) + { + in.addLink(link); + out_.addLink(link); + } } /** Modified: trunk/source/gridsim/GridSimTags.java =================================================================== --- trunk/source/gridsim/GridSimTags.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/GridSimTags.java 2008-08-03 06:00:43 UTC (rev 195) @@ -188,7 +188,25 @@ */ public static final int SCHEDULER_DEQUE = NETBASE + 10; + public static final int NET_PACKET_LEVEL = NETBASE + 11; + public static final int NET_FLOW_LEVEL = NETBASE + 12; + + public static final int NET_BUFFER_PACKET_LEVEL = NETBASE + 13; + + // Denotes flow en-route to destination (used manually by entities) + public static final int FLOW_SUBMIT = NETBASE + 14; + + // Internal message to check forecast of flow duration + public static final int FLOW_HOLD = NETBASE + 15; + + // Message to update forecast of flow duration + public static final int FLOW_UPDATE = NETBASE + 16; + + // Denotes flow ack en-route to destination (used manually by entities) + public static final int FLOW_ACK = NETBASE + 17; + + ///////////////////////////////////////////////////////////// // I intentionally put a gap to incorporate future tags // so I don't have to change the numbers! Modified: trunk/source/gridsim/net/Input.java =================================================================== --- trunk/source/gridsim/net/Input.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/net/Input.java 2008-08-03 06:00:43 UTC (rev 195) @@ -11,6 +11,8 @@ import gridsim.*; import gridsim.net.*; +import gridsim.util.TrafficGenerator; +import java.util.Collection; import eduni.simjava.*; /** @@ -29,7 +31,7 @@ * @since GridSim Toolkit 1.0 * @invariant $none */ -public class Input extends Sim_entity +public class Input extends Sim_entity implements NetIO { private Sim_port inPort_; private Link link_; @@ -64,8 +66,10 @@ * @pre link != null * @post $none */ - public void addLink(Link link) { + public void addLink(Link link) + { this.link_ = link; + baudRate_ = link_.getBaudRate(); } /** @@ -113,6 +117,37 @@ } /** + * This is an empty method and only applicable to + * {@link gridsim.net.Output} class. + * @param gen a background traffic generator + * @param userName a collection of user entity name (in String object). + * @return <tt>false</tt> since this method is not used by this class. + * @pre gen != null + * @pre userName != null + * @post $none + * @see gridsim.net.Output + */ + public boolean setBackgroundTraffic(TrafficGenerator gen, + Collection userName) + { + return false; + } + + /** + * This is an empty method and only applicable to + * {@link gridsim.net.Output} class. + * @param gen a background traffic generator + * @return <tt>false</tt> since this method is not used by this class. + * @pre gen != null + * @post $none + * @see gridsim.net.Output + */ + public boolean setBackgroundTraffic(TrafficGenerator gen) + { + return false; + } + + /** * A method that gets one process event at one time until the end * of a simulation, then delivers an event to the entity (its parent) * @pre $none Modified: trunk/source/gridsim/net/Link.java =================================================================== --- trunk/source/gridsim/net/Link.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/net/Link.java 2008-08-03 06:00:43 UTC (rev 195) @@ -96,7 +96,7 @@ throw new ParameterException(msg + "baud rate must be > 0."); } else if (propDelay <= 0) { - throw new ParameterException(msg+"propagation delay mut be < 0."); + throw new ParameterException(msg+"propagation delay must be > 0."); } else if (MTU <= 0) { throw new ParameterException(msg + "MTU must be > 0."); Modified: trunk/source/gridsim/net/Output.java =================================================================== --- trunk/source/gridsim/net/Output.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/net/Output.java 2008-08-03 06:00:43 UTC (rev 195) @@ -31,7 +31,7 @@ * @since GridSim Toolkit 1.0 * @invariant $none */ -public class Output extends Sim_entity +public class Output extends Sim_entity implements NetIO { private Sim_port outPort_; // output port private Link link_; // a link to this output entity @@ -180,6 +180,7 @@ public void addLink(Link link) { this.link_ = link; + baudRate_ = link_.getBaudRate(); packetList_ = new Vector(); } Modified: trunk/source/gridsim/net/Packet.java =================================================================== --- trunk/source/gridsim/net/Packet.java 2008-08-03 05:58:42 UTC (rev 194) +++ trunk/source/gridsim/net/Packet.java 2008-08-03 06:00:43 UTC (rev 195) @@ -17,7 +17,7 @@ /** - * This the structure for packets. + * This class contains the structure for a network packet. * * @since GridSim Toolkit 3.1 * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore @@ -64,7 +64,7 @@ * @post $none */ int getID(); - + /** * Returns the ID of the source of this packet. * @return source id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-08-03 05:58:33
|
Revision: 194 http://gridsim.svn.sourceforge.net/gridsim/?rev=194&view=rev Author: sulistio Date: 2008-08-03 05:58:42 +0000 (Sun, 03 Aug 2008) Log Message: ----------- initial release. this interface class is used to allow different I/O entity port. Added Paths: ----------- trunk/source/gridsim/net/NetIO.java Added: trunk/source/gridsim/net/NetIO.java =================================================================== --- trunk/source/gridsim/net/NetIO.java (rev 0) +++ trunk/source/gridsim/net/NetIO.java 2008-08-03 05:58:42 UTC (rev 194) @@ -0,0 +1,65 @@ +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Author: Anthony Sulistio + * Organization: The University of Melbourne, Australia + * Created on: Wednesday, 22 August 2007 + */ + +package gridsim.net; + +import gridsim.util.TrafficGenerator; +import java.util.Collection; + +/** + * This class contains the structure for Input and Output entities. + * @since GridSim Toolkit 4.1 + * @author Anthony Sulistio + */ +public interface NetIO +{ + /** + * Sets this entity's link. This should be used only if the network + * extensions are being used. + * + * @param link the link to which this entity should send/receive data + */ + void addLink(Link link); + + /** + * Gets the baud rate + * @return the baud rate + */ + double getBaudRate(); + + /** + * Sets the background traffic generator for <b>Output</b> entity only. + * <p> + * When simulation starts, this entity will automatically sends junk + * packets to resource entities. + * @param gen a background traffic generator + * @return <tt>true</tt> if successful, <tt>false</tt> otherwise + */ + boolean setBackgroundTraffic(TrafficGenerator gen); + + /** + * Sets the background traffic generator for <b>Output</b> entity only. + * <p> + * When simulation starts, this entity will automatically sends junk + * packets to resource entities and other entities. <br> + * NOTE: Sending background traffic to itself is not supported. + * + * @param gen a background traffic generator + * @param userName a collection of user entity name (in String object). + * @return <tt>true</tt> if successful, <tt>false</tt> otherwise + * @pre gen != null + * @pre userName != null + * @post $none + */ + boolean setBackgroundTraffic(TrafficGenerator gen, Collection userName); + +} // end interface + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-08-03 05:56:20
|
Revision: 193 http://gridsim.svn.sourceforge.net/gridsim/?rev=193&view=rev Author: sulistio Date: 2008-08-03 05:56:30 +0000 (Sun, 03 Aug 2008) Log Message: ----------- add a new package about the network flow functionality (initially was done in $SVN/branches/gridsim4.0-branch2). Note that this was done by James Broberg. Added Paths: ----------- trunk/source/gridsim/net/flow/ trunk/source/gridsim/net/flow/FilterFlow.java trunk/source/gridsim/net/flow/Flow.java trunk/source/gridsim/net/flow/FlowInput.java trunk/source/gridsim/net/flow/FlowLink.java trunk/source/gridsim/net/flow/FlowOutput.java trunk/source/gridsim/net/flow/FlowPacket.java trunk/source/gridsim/net/flow/FlowRouter.java Added: trunk/source/gridsim/net/flow/FilterFlow.java =================================================================== --- trunk/source/gridsim/net/flow/FilterFlow.java (rev 0) +++ trunk/source/gridsim/net/flow/FilterFlow.java 2008-08-03 05:56:30 UTC (rev 193) @@ -0,0 +1,99 @@ +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Author: James Broberg + * + */ + +package gridsim.net.flow; + +import eduni.simjava.Sim_predicate; +import eduni.simjava.Sim_event; + + +/** + * Look for a specific incoming event that matches a given event tag name and a + * flow id. Incoming events with a matching tag name <b>must</b> + * contain a data object of type + * <tt>Integer</tt>, where <tt>Integer</tt> stores the flow id. + * <br><br> + * + * This class is used by {@link eduni.simjava.Sim_system} + * to select or filter an event already present in the entity's deferred queue + * (incoming buffer), or used to selectively wait for a future event. + * <br> <br> + * + * + * + * @author James Broberg + * @since GridSim Toolkit 5.0 + * @invariant $none + */ +public class FilterFlow extends Sim_predicate +{ + private int tag_; // event tag to be matched + private int flowID_; // event or flow ID + + + /** + * Finds an incoming events that matches with the given flow ID and + * event tag name + * @param flowID a unique flow ID to differentiate + * itself among other events with the same tag name + * @param tag a matching event tag name + * @pre $none + * @post $none + */ + public FilterFlow(int flowID, int tag) + { + tag_ = tag; + flowID_ = flowID; + } + + /** + * Checks whether an event matches the required constraints or not.<br> + * NOTE: This method is not used directly by the user. Instead, it is + * called by {@link eduni.simjava.Sim_system}. + * + * @param ev an incoming event to compare with + * @return <tt>true</tt> if an event matches, <tt>false</tt> otherwise + * @pre ev != null + * @post $none + */ + public boolean match(Sim_event ev) + { + if (ev == null) { + return false; + } + + boolean result = false; + try + { + // find an event with a matching tag first + if ( tag_ == ev.get_tag() ) + { + Object obj = ev.get_data(); + + // if the event's data contains the correct data + if (obj instanceof Integer) + { + int id = (Integer)obj; + + // if the data contains the correct ID or value + if (id == flowID_) { + result = true; + } + } + } + } + catch (Exception e) { + result = false; + } + + return result; + } + +} // end class Added: trunk/source/gridsim/net/flow/Flow.java =================================================================== --- trunk/source/gridsim/net/flow/Flow.java (rev 0) +++ trunk/source/gridsim/net/flow/Flow.java 2008-08-03 05:56:30 UTC (rev 193) @@ -0,0 +1,118 @@ +/* + * ** Network and Service Differentiation Extensions to GridSim 4.0 ** + * + * James Broberg + * + * August 2007 + * + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * Flow.java - Interface of a Network Flow. + * + */ + +package gridsim.net.flow; + + +/** + * This the structure for network flows. + * + * @since GridSim Toolkit 4.0 + * @author James Broberg, The University of Melbourne + */ +public interface Flow +{ + /** + * Returns a string describing this flow in detail. + * @return description of this flow + * @pre $none + * @post $none + */ + String toString(); + + /** + * Returns the size of this flow + * @return size of the flow + * @pre $none + * @post $none + */ + long getSize(); + + /** + * Sets the size of this flow + * @param size size of the flow + * @return <tt>true</tt> if it is successful, <tt>false</tt> otherwise + * @pre size >= 0 + * @post $none + */ + boolean setSize(long size); + + /** + * Returns the destination id of this flow. + * @return destination id + * @pre $none + * @post $none + */ + int getDestID(); + + /** + * Returns the ID of this flow + * @return flow ID + * @pre $none + * @post $none + */ + int getID(); + + /** + * Returns the ID of the source of this flow. + * @return source id + * @pre $none + * @post $none + */ + int getSrcID(); + + /** + * Gets the network service type of this flow + * @return the network service type + * @pre $none + * @post $none + */ + int getNetServiceType(); + + /** + * Sets the network service type of this flow. + * <p> + * By default, the service type is 0 (zero). It is depends on the packet + * scheduler to determine the priority of this service level. + * @param serviceType this flow's service type + * @pre serviceType >= 0 + * @post $none + */ + void setNetServiceType(int serviceType); + + /** + * Gets an entity ID from the last hop that this packet has traversed. + * @return an entity ID + * @pre $none + * @post $none + */ + int getLast(); + + /** + * Sets an entity ID from the last hop that this packet has traversed. + * @param last an entity ID from the last hop + * @pre last > 0 + * @post $none + */ + void setLast(int last); + + /** + * Gets this flow tag + * @return this flow tag + * @pre $none + * @post $none + */ + int getTag(); + +} // end interface + Added: trunk/source/gridsim/net/flow/FlowInput.java =================================================================== --- trunk/source/gridsim/net/flow/FlowInput.java (rev 0) +++ trunk/source/gridsim/net/flow/FlowInput.java 2008-08-03 05:56:30 UTC (rev 193) @@ -0,0 +1,478 @@ +/* + * ** Network and Service Differentiation Extensions to GridSim 4.0 ** + * + * Author: James Broberg (based on Input.java) + * + * March 2007 + * + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * FlowInput.java - Simulates a network input port + * + */ + +package gridsim.net.flow; + +import gridsim.*; +import gridsim.net.*; +import gridsim.util.TrafficGenerator; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; + +import eduni.simjava.*; + +/** + * GridSim FlowInput class defines a port through which a simulation entity + * receives data from the simulated network. + * <p> + * It maintains an event queue + * to serialize the data-in-flow and delivers to its parent entity. + * It accepts messages that comes from GridSim entities 'FlowOutput' entity + * and passes the same to the GridSim entity. + * It simulates Network communication delay depending on current bottleneck Baud rate + * and data length. Simultaneous inputs can be modeled using multiple + * instances of this class. + * + * @author James Broberg + * @since GridSim Toolkit 5.0 + * @invariant $none + */ +public class FlowInput extends Sim_entity implements NetIO +{ + private Sim_port inPort_; + private Link link_; + private double baudRate_; + private static final int BITS = 8; // 1 byte = 8 bits + private final int SIZE = 8; // 1 byte in bits + + + private HashMap<Integer, Packet> activeFlows_; // stores a list of active Flows + + + /** + * Allocates a new FlowInput object + * @param name the name of this object + * @param baudRate the communication speed + * @throws NullPointerException This happens when creating this entity + * before initializing GridSim package or this entity name + * is <tt>null</tt> or empty + * @pre name != null + * @pre baudRate >= 0.0 + * @post $none + */ + public FlowInput(String name, double baudRate) throws NullPointerException + { + super(name); + this.baudRate_ = baudRate; + link_= null; + + inPort_ = new Sim_port("input_buffer"); + super.add_port(inPort_); + + activeFlows_ = null; + + } + + /** + * Sets the FlowInput entities link. This should be used only if the network + * extensions are being used. + * @param link the link to which this FlowInput entity should send data + * @pre link != null + * @post $none + */ + public void addLink(Link link) + { + this.link_ = link; + baudRate_ = link_.getBaudRate(); + activeFlows_ = new HashMap(); + + } + + /** + * Gets the baud rate + * @return the baud rate + * @deprecated As of GridSim 2.1, replaced by {@link #getBaudRate()} + * @pre $none + * @post $result >= 0.0 + */ + public double GetBaudRate() { + return this.getBaudRate(); + } + + /** + * Gets the baud rate + * @return the baud rate + * @pre $none + * @post $result >= 0.0 + */ + public double getBaudRate() { + return baudRate_; + } + + /** + * Gets the I/O real number based on a given value + * @param value the specified value + * @return real number + * @deprecated As of GridSim 2.1, replaced by {@link #realIO(double)} + * @pre value >= 0.0 + * @post $result >= 0.0 + */ + public double real_io(double value) { + return this.realIO(value); + } + + /** + * Gets the I/O real number based on a given value + * @param value the specified value + * @return real number + * @pre value >= 0.0 + * @post $result >= 0.0 + */ + public double realIO(double value) { + return GridSimRandom.realIO(value); + } + + /** + * This is an empty method and only applicable to + * {@link gridsim.net.FlowOutput} class. + * @param gen a background traffic generator + * @param userName a collection of user entity name (in String object). + * @return <tt>false</tt> since this method is not used by this class. + * @pre gen != null + * @pre userName != null + * @post $none + * @see gridsim.net.Output + */ + public boolean setBackgroundTraffic(TrafficGenerator gen, + Collection userName) + { + return false; + } + + /** + * This is an empty method and only applicable to + * {@link gridsim.net.Output} class. + * @param gen a background traffic generator + * @return <tt>false</tt> since this method is not used by this class. + * @pre gen != null + * @post $none + * @see gridsim.net.Output + */ + public boolean setBackgroundTraffic(TrafficGenerator gen) + { + return false; + } + + /** + * A method that gets one process event at one time until the end + * of a simulation, then delivers an event to the entity (its parent) + * @pre $none + * @post $none + */ + public void body() + { + // Process events + Object obj = null; + while ( Sim_system.running() ) + { + Sim_event ev = new Sim_event(); + super.sim_get_next(ev); // get the next event in the queue + obj = ev.get_data(); // get the incoming data + + System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag()); + System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src()); + + // if the simulation finishes then exit the loop + if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) { + break; + // Check forecast of active flow and pass it onto Entity if still active + } else if(ev.get_tag() == GridSimTags.FLOW_HOLD) { + System.out.println(super.get_name() + ".body(): checkForecast() + at time = " + GridSim.clock()); + checkForecast(ev); + // Update flow duration forecast as a flow's bottleneck bandwidth has changed + } else if (ev.get_tag() == GridSimTags.FLOW_UPDATE) { + System.out.println(super.get_name() + ".body(): updateForecast() + at time = " + GridSim.clock()); + updateForecast(ev); + // if this entity is not connected in a network topology + } else if (obj != null && obj instanceof IO_data) { + System.out.println(super.get_name() + ".body(): getDataFromEvent() + at time = " + GridSim.clock()); + getDataFromEvent(ev); + // if this entity belongs to a network topology + } else if (obj != null && link_ != null) { + System.out.println(super.get_name() + ".body(): getDataFromLink() + at time = " + GridSim.clock()); + getDataFromLink(ev); + } + + ev = null; // reset to null for gc to collect + } + + System.out.println(super.get_name() + ":%%%% Exiting body() at time " + + GridSim.clock() ); + } + + /** + * Check the forecast of a flow, and send data to output port if flow still exists + * + * @param ev the flow hold notification event + * @pre ev != null + * @post $none + */ + private void checkForecast(Sim_event ev) { + int pktID = (Integer) ev.get_data(); // ID of flow to be checked + FlowPacket fp = null; // Reference to flow packet that needs forecast update + + System.out.println(super.get_name() + ".checkForecast(): checking pkt id # " + pktID); + + // If flow hasn't already finished, send it to inPort + if ((fp = (FlowPacket) activeFlows_.get(pktID)) != null) { + Object data = fp.getData(); + IO_data io = new IO_data( data, fp.getSize(), + inPort_.get_src()); + super.sim_schedule(inPort_, GridSimTags.SCHEDULE_NOW, fp.getTag() , io.getData()); + activeFlows_.remove(pktID); + + System.out.println(super.get_name() + ".checkForecast(): flow came from " + GridSim.getEntityName(fp.getSrcID()) + + " heading to " + GridSim.getEntityName(fp.getDestID())); + + // Deregister flow on all active links + Iterator it = (fp.getLinks_()).iterator(); + while (it.hasNext()) { + FlowLink fl = (FlowLink) it.next(); + fl.deregisterFlow(fp); + } + + } else { + System.out.println(super.get_name() + ".checkForecast(): pkt id # " + pktID + " already removed"); + + } + + } + + /** + * Update the forecast of a flow by deleting the old forecast and scheduling a new flow hold + * event in the future with the corrected forecast (based on new bottleneck bandwidth and + * the amount of flow already sent) + * + * @param ev the flow update notification event + * @pre ev != null + * @post $none + */ + private void updateForecast(Sim_event ev) { + int pktID = (Integer) ev.get_data(); // ID of flow to be updated + FlowPacket fp = null; // Reference to flow packet that needs forecast update + double duration = 0.0; // New forecast duration from current Gridsim.clock() + long remSizeOld = 0; // Previous remaining size + double bandwidthOld = 0.0; // Previous bottleneck BW + int sourceID = ev.get_src(); // ID of source of notification (FlowLink) + int cancelledFlow = 0; // Count of canceled future events that match old forecast + + System.out.println(super.get_name() + ".updateForecast(): updating pkt id # " + pktID); + + // If flow hasn't already finished and been cleared... + if ((fp = (FlowPacket) activeFlows_.get(pktID)) != null) { + remSizeOld = fp.getRemSize(); + bandwidthOld = fp.getBandwidth_(); + System.out.println(super.get_name() + "updateForecast(): rem size is " + remSizeOld + + "BW old is " + bandwidthOld + " last update " + fp.getUpdateTime()); + Iterator it = (fp.getLinks_()).iterator(); + + // Find the source link of this notification and the associated bottleneck bandwidth + while (it.hasNext()) { + FlowLink fl = (FlowLink) it.next(); + if (fl.get_id() == sourceID) { + fp.setBandwidth_(fl.getBaudRate()); + fp.setBottleneckID(sourceID); + } + } + + fp.setRemSize((long)((remSizeOld) - ((GridSim.clock()-fp.getUpdateTime())*(bandwidthOld/BITS)))); + duration = (fp.getRemSize()*BITS)/fp.getBandwidth_(); + System.out.println(super.get_name() + " new forecast end time is " + (GridSim.clock() + duration)); + + // Find old forecast and delete it! + FilterFlow filter = new FilterFlow(fp.getID(), GridSimTags.FLOW_HOLD); + cancelledFlow = this.sim_cancel(filter, null); + + if (cancelledFlow != 0) { + System.out.println(super.get_name() + ".updateForecast(): old forecast cancelled #matches " + + cancelledFlow); + } + + System.out.println(super.get_name() + " setting updated forecast for packet #" + fp.getID()); + // Make a note of the time when this forecast update was performed + fp.setUpdateTime(GridSim.clock()); + // Set new future event with the correct finish time + super.sim_schedule(super.get_id(), duration, GridSimTags.FLOW_HOLD , new Integer(fp.getID())); + + } + } + + /** + * Process incoming event for data without using the network extension + * @param ev a Sim_event object + * @pre ev != null + * @post $none + */ + private void getDataFromEvent(Sim_event ev) + { + IO_data io = (IO_data) ev.get_data(); + + // if the sender is not part of the overall network topology + // whereas this entity is, then need to return back the data, + // since it is not compatible. + if (link_ != null) + { + // outName = "Output_xxx", where xxx = sender entity name + String outName = GridSim.getEntityName( ev.get_src() ); + + // NOTE: this is a HACK job. "Output_" has 7 chars. So, + // the idea is to get only the entity name by removing + // "Output_" word in the outName string. + String name = outName.substring(7); + + // if the sender is not system GIS then ignore the message + if (GridSim.getEntityId(name) != GridSim.getGridInfoServiceEntityId()) + { + // sends back the data to "Input_xxx", where + // xxx = sender entity name. If not sent, then the sender + // will wait forever to receive this data. As a result, + // the whole simulation program will be hanged or does not + // terminate successfully. + int id = GridSim.getEntityId("Input_" + name); + super.sim_schedule(id, 0.0, ev.get_tag(), io); + + // print an error message + System.out.println(super.get_name() + ".body(): Error - " + + "incompatible message protocol."); + System.out.println(" Sender: " + name + " is not part " + + "of this entity's network topology."); + System.out.println(" Hence, sending back the received data."); + System.out.println(); + return; + } + } + + // NOTE: need to have a try-catch statement. This is because, + // if the above if statement holds, then Input_receiver will send + // back to Input_sender without going through Output_receiver entity. + // Hence, a try-catch is needed to prevent exception of wrong casting. + try + { + // Simulate Transmission Time after Receiving + // Hold first then dispatch + double senderBaudRate = ( (FlowOutput) + Sim_system.get_entity(ev.get_src()) ).getBaudRate(); + + // NOTE: io is in byte and baud rate is in bits. 1 byte = 8 bits + // So, convert io into bits + double minBaudRate = Math.min(baudRate_, senderBaudRate); + double communicationDelay = GridSimRandom.realIO( + (io.getByteSize() * BITS) / minBaudRate); + + // NOTE: Below is a deprecated method for SimJava 2 + //super.sim_hold(communicationDelay); + super.sim_process(communicationDelay); // receiving time + } + catch (Exception e) { + // .... empty + } + + // Deliver Event to the entity (its parent) to which + // it is acting as buffer + super.sim_schedule( inPort_, GridSimTags.SCHEDULE_NOW, + ev.get_tag(), io.getData() ); + } + + /** + * Process incoming events from senders that are using the network + * extension + * @param ev a Sim_event object + * @pre ev != null + * @post $none + */ + private void getDataFromLink(Sim_event ev) + { + Object obj = ev.get_data(); + double duration = 0.0; + + if (obj instanceof Packet) + { + // decrypt the packet into original format + Packet pkt = (Packet) ev.get_data(); + + if (pkt instanceof InfoPacket) + { + processPingRequest( (InfoPacket) pkt); + return; + } + + if (pkt instanceof FlowPacket) + { + FlowPacket np = (FlowPacket) pkt; + int tag = np.getTag(); + System.out.println("Packet id is " + np.getID()); + + // ignore incoming junk packets + if (tag == GridSimTags.JUNK_PKT) { + return; + } + + // ignore incoming null dummy packets + if (tag == GridSimTags.EMPTY_PKT && np.getData() == null) { + return; + } + + System.out.println(super.get_name() + ".getDataFromLink() Time now " + GridSim.clock() + + " bottleneck is " + np.getBandwidth_() + " sum lat is " + np.getLatency() ); + + // if flow terminates at next entity, add to active flows + // & hold for appropriate duration + if (pkt.getTag() == GridSimTags.FLOW_SUBMIT || pkt.getTag() == GridSimTags.GRIDLET_SUBMIT || + pkt.getTag() == GridSimTags.GRIDLET_SUBMIT_ACK || pkt.getTag() == GridSimTags.GRIDLET_RETURN + || pkt.getTag() == GridSimTags.JUNK_PKT) { + np.setStartTime(GridSim.clock()); + np.setUpdateTime(GridSim.clock()); + duration = np.getSize()*SIZE / np.getBandwidth_(); + activeFlows_.put(pkt.getID(), pkt); + super.sim_schedule(super.get_id(), duration, GridSimTags.FLOW_HOLD, new Integer(pkt.getID())); + System.out.println(super.get_name() + ".getDataFromLink() initial forecast flow end at " + (GridSim.clock() + + duration)); + return; + } + + // convert the packets into IO_data + Object data = np.getData(); + IO_data io = new IO_data( data, np.getSize(), + inPort_.get_dest() ); + + // send the data into entity input port + super.sim_schedule(inPort_, GridSimTags.SCHEDULE_NOW, tag, + io.getData() ); + + + } + } + } + + /** + * Processes a ping request + * @param pkt a packet for pinging + * @pre pkt != null + * @post $none + */ + private void processPingRequest(InfoPacket pkt) + { + // add more information to ping() packet + pkt.addHop( inPort_.get_dest() ); + pkt.addEntryTime( GridSim.clock() ); + + IO_data io = new IO_data( pkt, pkt.getSize(), inPort_.get_dest() ); + + // send this ping() packet to the entity + super.sim_schedule(inPort_, GridSimTags.SCHEDULE_NOW, + pkt.getTag(), io.getData()); + } + +} // end class + Added: trunk/source/gridsim/net/flow/FlowLink.java =================================================================== --- trunk/source/gridsim/net/flow/FlowLink.java (rev 0) +++ trunk/source/gridsim/net/flow/FlowLink.java 2008-08-03 05:56:30 UTC (rev 193) @@ -0,0 +1,525 @@ +/* + * ** Network and Service Differentiation Extensions to GridSim 4.0 ** + * + * Author: James Broberg + * + * March 2007 + * + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * FlowLink.java - Simulates a network link with active flows (based on SimpleLink.java) + * + */ + +package gridsim.net.flow; + +import eduni.simjava.*; +import gridsim.*; + +import java.util.*; +import gridsim.net.Link; +import gridsim.net.Packet; +import gridsim.net.flow.FlowPacket; + + +/** + * This class enables flow level networking over a shared link. It is partially based + * on SimpleLink.java by Gokul Poduval & Chen-Khong Tham + * + * @invariant $none + * @since GridSim Toolkit 5.0 + * @author James Broberg, The University of Melbourne + */ + +public class FlowLink extends Link +{ + private Vector q_; + private HashMap activeFlows_; // Stores references to flows that are currently active on this link + private double lastUpdateTime_; // a timer to denote the last update time + private int inEnd1_; + private int outEnd1_; + private int inEnd2_; + private int outEnd2_; + + + /** + * Constructs a Link which simulates a physical link between two entities. + * + * @param name Name of this Link + * @param baudRate baud rate of this link (bits/s) + * @param propDelay Propogation delay of the Link in milli seconds + * @param MTU Maximum Transmission Unit of the Link in bytes. + * Packets which are larger than the MTU should be split + * up into MTU size units. <br> + * For e.g. a 1024 byte packet trying to cross a 576 byte + * MTU link should get split into 2 packets of 576 bytes + * and 448 bytes. + * @throws NullPointerException This happens when name is empty or null + * @throws ParameterException This happens for the following conditions: + * <ul> + * <li> name is null + * <li> baudRate <= 0 + * <li> propDelay <= 0 + * <li> MTU <= 0 + * </ul> + * + * @pre name != null + * @pre baudRate > 0 + * @pre propDelay > 0 + * @pre MTU > 0 + * @post $none + */ + public FlowLink(String name, double baudRate, double propDelay, int MTU) + throws ParameterException, NullPointerException + { + super(name, baudRate, propDelay, MTU); + init(); + } + + /** + * Constructs a link with some default parameters. It simulates a link with + * a default value of baud rate, propagation delay and MTU. + * + * @param name Name of this Link + * @throws NullPointerException This happens when name is empty or null + * @throws ParameterException This happens when the given name is empty + * @see gridsim.net.Link#DEFAULT_BAUD_RATE + * @see gridsim.net.Link#DEFAULT_PROP_DELAY + * @see gridsim.net.Link#DEFAULT_MTU + * @pre name != null + * @post $none + */ +/* public FlowLink(String name) throws ParameterException, + NullPointerException + { + super(name, Link.DEFAULT_BAUD_RATE, Link.DEFAULT_PROP_DELAY, + Link.DEFAULT_MTU); + + init(); + }*/ + + /** + * Initialises all attributes + * @pre $none + * @post $none + */ + private void init() + { + lastUpdateTime_ = 0.0; + q_ = new Vector(); + activeFlows_ = new HashMap(); + inEnd1_ = -1; + outEnd1_ = -1; + inEnd2_ = -1; + outEnd2_ = -1; + } + + /** + * Connects one entity to another via this link + * @param end1 an entity + * @param end2 an entity + * @pre end1 != null + * @pre end2 != null + * @post $none + */ + public void attach(Sim_entity end1, Sim_entity end2) + { + if (end1 == null || end2 == null) + { + System.out.println(super.get_name() + ".attach(): Warning - " + + "one or both entities are null."); + return; + } + + inEnd1_ = GridSim.getEntityId( "Input_" + end1.get_name() ); + outEnd1_ = GridSim.getEntityId( "Output_" + end1.get_name() ); + + // if end1 is a router/gateway with no Input and Output port + if (inEnd1_ == -1 || outEnd1_ == -1) + { + inEnd1_ = end1.get_id(); + outEnd1_ = end1.get_id(); + } + + inEnd2_ = GridSim.getEntityId( "Input_" + end2.get_name() ); + outEnd2_ = GridSim.getEntityId( "Output_" + end2.get_name() ); + + // if end1 is a router/gateway with no Input and Output port + if (inEnd2_ == -1 || outEnd2_ == -1) + { + inEnd2_ = end2.get_id(); + outEnd2_ = end2.get_id(); + } + } + + /** + * Connects one entity to another via this link + * @param end1 an Entity name + * @param end2 an Entity name + * @pre end1 != null + * @pre end2 != null + * @post $none + */ + public void attach(String end1, String end2) + { + if (end1 == null || end2 == null) + { + System.out.println(super.get_name() + ".attach(): Warning - " + + "can not connect since one or both entities are null."); + return; + } + + if (end1.length() == 0 || end2.length() == 0) + { + System.out.println(super.get_name() + ".attach(): Warning - " + + "can not connect since one or both entities are null."); + return; + } + + inEnd1_ = GridSim.getEntityId("Input_" + end1); + outEnd1_ = GridSim.getEntityId("Output_" + end1); + + // if end1 is a router/gateway with no Input and Output port + if (inEnd1_ == -1 || outEnd1_ == -1) + { + inEnd1_ = GridSim.getEntityId(end1); + outEnd1_ = inEnd1_; + } + + inEnd2_ = GridSim.getEntityId("Input_" + end2); + outEnd2_ = GridSim.getEntityId("Output_" + end2); + + // if end1 is a router/gateway with no Input and Output port + if (inEnd2_ == -1 || outEnd2_ == -1) + { + inEnd2_ = GridSim.getEntityId(end1); + outEnd2_ = inEnd2_; + } + } + + /** + * Handles external events that are coming to this link. + * @pre $none + * @post $none + */ + public void body() + { + // register oneself to the system GIS + super.sim_schedule(GridSim.getGridInfoServiceEntityId(), + GridSimTags.SCHEDULE_NOW, GridSimTags.REGISTER_LINK, + new Integer(super.get_id()) ); + + Sim_event ev = new Sim_event(); + while ( Sim_system.running() ) + { + super.sim_get_next(ev); + + System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag()); + System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src()); + + // if the simulation finishes then exit the loop + if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) { + break; + } + + // process the received event + System.out.println(super.get_name() + ".body(): processEvent() at time = " + GridSim.clock()); + processEvent(ev); + sim_completed(ev); + } + + while(sim_waiting() > 0) + { + // wait for event and ignore + System.out.println(super.get_name() + ".body(): Ignore !!"); + sim_get_next(ev); + } + + System.out.println(super.get_name() + ":%%%% Exiting body() at time " + + GridSim.clock() ); + } + + /** + * Processes incoming events + * @param ev a Sim_event object + * @pre ev != null + * @post $none + */ + private void processEvent(Sim_event ev) + { + switch ( ev.get_tag() ) + { + case GridSimTags.PKT_FORWARD: // for normal packets + case GridSimTags.JUNK_PKT: // for background traffic + System.out.println(super.get_name() + ".processEvent(): enque() at time = " + GridSim.clock()); + enque(ev); + break; + + case GridSimTags.INSIGNIFICANT: + System.out.println(super.get_name() + ".processEvent(): processInternalEvent() + at time = " + GridSim.clock()); + processInternalEvent(); + break; + + default: + System.out.println(super.get_name() + ".body(): Warning - " + + "unable to handle request from GridSimTags " + + "with constant number " + ev.get_tag()); + break; + } + } + + /** + * Sends an internal event to itself for a certain time period + * @param time the delay time + * @pre time >= 0 + * @post $none + */ + private synchronized boolean sendInternalEvent(double time) + { + System.out.println(super.get_name() + " sendInternalEvent(): called at time = " + GridSim.clock()); + + if (time < 0.0) { + System.out.println(super.get_name() + " sendInternalEvent(): false at time = " + GridSim.clock()); + return false; + } + + System.out.println(super.get_name() + " sendInternalEvent(): scheduled for = " + time + " from now"); + super.sim_schedule(super.get_id(), time, GridSimTags.INSIGNIFICANT); + return true; + } + + /** + * Processes internal events + * @pre $none + * @post $none + */ + private synchronized void processInternalEvent() + { + + System.out.println(super.get_name() + "processInternalEvent(): " + GridSim.clock()); + + // this is a constraint that prevents an infinite loop + // Compare between 2 floating point numbers. This might be incorrect + // for some hardware platform. + if ( lastUpdateTime_ == GridSim.clock() ) { + return; + } + + lastUpdateTime_ = GridSim.clock(); + + if (q_.size() == 0) { + return; + } + else if (q_.size() == 1) { + deque( (Packet) q_.remove(0) ); + } + else + { + deque( (Packet)q_.remove(0) ); + sendInternalEvent(super.delay_ / super.MILLI_SEC); // delay in ms + + } + + System.out.println("Super.delay_ is " + super.delay_); + System.out.println(super.get_name() + " processInternalEvent(): done at time = " + GridSim.clock()); + } + + /** + * Puts an event into a queue, sends an internal event to itself and registers the flow + * @param ev a Sim_event object + * @pre ev != null + * @post $none + */ + private synchronized void enque(Sim_event ev) + { + System.out.println(super.get_name() + " enque() + at time = " + GridSim.clock()); + int tag = ((Packet)ev.get_data()).getTag(); + // Register passing flow, gridlet or junk as active on this link + if (tag == GridSimTags.FLOW_SUBMIT || tag == GridSimTags.GRIDLET_SUBMIT || + tag == GridSimTags.GRIDLET_SUBMIT_ACK || tag == GridSimTags.GRIDLET_RETURN || + tag == GridSimTags.JUNK_PKT) { + registerFlow((Packet)ev.get_data()); + } + + q_.add( ev.get_data() ); + if (q_.size() == 1) { + sendInternalEvent(super.delay_ / super.MILLI_SEC); // delay in ms + } + + + } + + /** + * Sends a packet to the next destination + * @param np a packet + * @pre np != null + * @post $none + */ + private synchronized void deque(Packet np) + { + + System.out.println(super.get_name() + ".deque() for packet " + np.getID() +" here"); + System.out.println(super.get_name() + ".deque() packet " + np.toString()); + + + int dest = getNextHop(np); + if (dest == -1) { + System.out.println(super.get_name() + ".deque() here3"); + return; + } + + // other side is a Sim_entity + int tag = 0; + if (dest == outEnd2_ || dest == outEnd1_) + { + System.out.println(super.get_name() + ".deque() here1"); + + // for junk packets only + if (np.getTag() == GridSimTags.JUNK_PKT) { + tag = GridSimTags.JUNK_PKT; + } + // for other packets + else { + tag = GridSimTags.PKT_FORWARD; + } + } + // other side is a GridSim entity + else { + System.out.println(super.get_name() + ".deque() here2"); + + tag = np.getTag(); + } + + // sends the packet + super.sim_schedule(dest, GridSimTags.SCHEDULE_NOW, tag, np); + System.out.println(super.get_name() + ".deque() + at time = " + GridSim.clock()); + + } + + /** + * Determines which end to send the event to + * since sending entities are of the form Output_entityName. + * We need to check whether the source name ends with either end1 or end2 + * the other end is the destination + * @param np a packet + * @pre np != null + * @post $none + */ + private synchronized int getNextHop(Packet np) + { + int dest = -1; + int src = np.getLast(); + + // check if source is from outEnd1_ + if (src == outEnd1_) { + dest = inEnd2_; + } + // or source is from outEnd2_ + else if (src == outEnd2_) { + dest = inEnd1_; + } + + return dest; + } + + /** + * Registers active flow to the link, and the link to flow. + * Notifies the destination of any active flows if the bottleneck + * bandwidth is changed. + * @param np a packet + * @pre $none + * @post $none + */ + private synchronized void registerFlow(Packet np) { + + FlowPacket tempFlow = null; + + // Add flow to link + activeFlows_.put(np.getID(), np ); + + System.out.println(super.get_name() + ".registerFlow(): registering flow #" + np.getID() + + " total of " + activeFlows_.size() + " flows"); + + // Register link to flow + ((FlowPacket)np).addLink(this); + + // Check if this affects any existing flows + Iterator<Integer> flowsIter = activeFlows_.keySet().iterator(); + while(flowsIter.hasNext()) { + tempFlow = (FlowPacket) activeFlows_.get(flowsIter.next()); + // If change in bandwidth affects an existing flow i.e. is < current bottleneck + if (this.getBaudRate() < tempFlow.getBandwidth_() && tempFlow.getID() != np.getID()) { + // Need to notify flow + System.out.println(super.get_name() + ".registerFlow(): flow #" + np.getID() + + " bottleneck now " + this.getBaudRate() + " at time " + GridSim.clock()); + // I can notify directly as I know the destId's!!!! + System.out.println(super.get_name() + ".registerFlow(): updating flow #" + tempFlow.getID() + + " destination " + tempFlow.getDestID()); + super.sim_schedule(GridSim.getEntityId("Input_" + + GridSim.getEntityName(tempFlow.getDestID())), GridSimTags.SCHEDULE_NOW, + GridSimTags.FLOW_UPDATE, new Integer(tempFlow.getID())); + } + } + } + + /** + * Deregisters active flow on link. Notifies the destination of any active + * flows if the bottleneck bandwidth is changed. + * @param np a packet + * @pre $none + * @post $none + */ + public synchronized void deregisterFlow(Packet np) { + FlowPacket fp = null; + FlowPacket tempFlow; + + // If the flow hasn't been removed already, remove from active flow list + if ((fp = (FlowPacket) activeFlows_.remove(np.getID())) != null) { + + System.out.println(super.get_name() + ".deregisterFlow() success flow # " + np.getID() + + " " + fp.getBandwidth_()); + + // Check if this affects any existing flows + Iterator<Integer> flowsIter = activeFlows_.keySet().iterator(); + while(flowsIter.hasNext()) { + tempFlow = (FlowPacket) activeFlows_.get(flowsIter.next()); + // If change in bandwidth affects an existing flow i.e. is > current bottleneck + // AND this link is the particular flow's bottleneck + if (this.getBaudRate() > tempFlow.getBandwidth_() && tempFlow.getID() != np.getID() && + tempFlow.getBottleneckID() == this.get_id()) { + // Need to notify flow + System.out.println(super.get_name() + ".deregisterFlow(): flow #" + np.getID() + + " bottleneck now " + this.getBaudRate() + " at time " + GridSim.clock()); + // I can notify directly as I know the destId's!!!! + System.out.println(super.get_name() + ".deregisterFlow(): updating flow #" + tempFlow.getID() + + " destination " + tempFlow.getDestID()); + super.sim_schedule(GridSim.getEntityId("Input_" + + GridSim.getEntityName(tempFlow.getDestID())), GridSimTags.SCHEDULE_NOW, + GridSimTags.FLOW_UPDATE, new Integer(tempFlow.getID())); + } + + } + } + } + + /** + * Returns available baudRate depending on number of + * active flows (MIN_MAX bandwidth sharing model) + * @pre $none + * @post $none + */ + public synchronized double getBaudRate() { + if (activeFlows_.size() != 0) { + System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)/(activeFlows_.size())); + return (super.baudRate_)/(activeFlows_.size()); + } else { + System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)); + return super.baudRate_; + } + + } + + + +} // end class + Added: trunk/source/gridsim/net/flow/FlowOutput.java =================================================================== --- trunk/source/gridsim/net/flow/FlowOutput.java (rev 0) +++ trunk/source/gridsim/net/flow/FlowOutput.java 2008-08-03 05:56:30 UTC (rev 193) @@ -0,0 +1,714 @@ +/* + * ** Network and Service Differentiation Extensions to GridSim 4.0 ** + * + * Author: James Broberg + * + * March 2007 + * + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * FlowOutput.java - Simulates a network output port + * + */ + +package gridsim.net.flow; + +import gridsim.*; +import gridsim.net.*; +import gridsim.util.*; + +import eduni.simjava.*; + +import java.util.*; +import java.util.Random; + + +/** + * GridSim FlowOutput defines a port through which a simulation entity sends + * data to the simulated network. + * <p> + * It maintains an event queue to serialize + * the data-out-flow and delivers to the destination entity. + * It works along with FlowInput entity to simulate network + * communication delay. Simultaneous outputs can be modeled by using multiple + * instances of this class + * + * @author James Broberg + * @since GridSim Toolkit 5.0 + * @invariant $none + */ +public class FlowOutput extends Sim_entity implements NetIO +{ + private Sim_port outPort_; // output port + private Link link_; // a link to this output entity + private double baudRate_; // baud rate of this entity + private final int SIZE = 8; // 1 byte in bits + private static int pktID_ = 0; // packet ID counter + private Vector flowList_; // store a list of packets + private Random random_; // selects to which junk packets go to + private TrafficGenerator gen_; // background traffic generator + private ArrayList list_; // list of resources + user entities + private boolean hasStarted_; // a flag for background traffic has started + private static final int BITS = 8; // 1 byte = 8 bits + + private Random rnd; // Random number generator to generate unique + // flow ID's + + + /** + * Allocates a new FlowOutput object + * @param name the name of this object + * @param baudRate the communication speed + * @throws NullPointerException This happens when creating this entity + * before initializing GridSim package or this entity name + * is <tt>null</tt> or empty + * @pre name != null + * @pre baudRate >= 0.0 + * @post $none + */ + public FlowOutput(String name, double baudRate) throws NullPointerException + { + super(name); + this.baudRate_ = baudRate; + link_ = null; + flowList_ = null; + pktID_ = 0; + + outPort_ = new Sim_port("output_buffer"); + super.add_port(outPort_); + + // for sending background traffic + gen_ = null; + list_ = null; + random_ = null; + hasStarted_ = false; + + rnd = new Random(); + } + + /** + * Sets the background traffic generator for this entity. + * <p> + * When simulation starts, this entity will automatically sends junk + * packets to resource entities. + * @param gen a background traffic generator + * @return <tt>true</tt> if successful, <tt>false</tt> otherwise + * @pre gen != null + * @post $none + */ + public boolean setBackgroundTraffic(TrafficGenerator gen) + { + if (gen == null) { + return false; + } + + gen_ = gen; + if (list_ == null) { + list_ = new ArrayList(); + } + + return true; + } + + /** + * Sets the background traffic generator for this entity. + * <p> + * When simulation starts, this entity will automatically sends junk + * packets to resource entities and other entities. <br> + * NOTE: Sending background traffic to itself is not supported. + * + * @param gen a background traffic generator + * @param userName a collection of user entity name (in String object). + * @return <tt>true</tt> if successful, <tt>false</tt> otherwise + * @pre gen != null + * @pre userName != null + * @post $none + */ + public boolean setBackgroundTraffic(TrafficGenerator gen, + Collection userName) + { + if (gen == null || userName == null) { + return false; + } + + boolean flag = true; + try + { + gen_ = gen; + if (list_ == null) { + list_ = new ArrayList(); + } + + // iterates through each list to check whether it is a valid + // entity name or not + Iterator it = userName.iterator(); + int id = -1; + while( it.hasNext() ) + { + String name = (String) it.next(); + + // check whether it is sending to itself + id = GridSim.getEntityId("Output_" + name); + if (id == super.get_id()) + { + System.out.println(super.get_name() + + ".setBackgroundTraffic(): Warning - can not send " + + "junk packets to itself."); + continue; + } + + // get the ID of other entity + id = GridSim.getEntityId(name); + if (id > 0) + { + Integer obj = new Integer(id); + list_.add(obj); + } + // ignore for invalid entity + else + { + System.out.println(super.get_name() + + ".setBackgroundTraffic(): Warning - invalid entity " + + "name for \"" + name + "\"."); + } + } + } + catch(Exception e) { + flag = false; + } + + return flag; + } + + /** + * Sets this entity's link. This should be used only if the network + * extensions are being used. + * + * @param link the link to which this Output entity should send data + * @pre link != null + * @post $none + */ + public void addLink(Link link) + { + this.link_ = link; + baudRate_ = link_.getBaudRate(); + flowList_ = new Vector(); + } + + /** + * Gets the baud rate + * @return the baud rate + * @deprecated As of GridSim 2.1, replaced by {@link #getBaudRate()} + * @pre $none + * @post $result >= 0.0 + */ + public double GetBaudRate() { + return this.getBaudRate(); + } + + /** + * Gets the baud rate + * @return the baud rate + * @pre $none + * @post $result >= 0.0 + */ + public double getBaudRate() { + return baudRate_; + } + + /** + * Gets the I/O real number based on a given value + * @param value the specified value + * @return real number + * @deprecated As of GridSim 2.1, replaced by {@link #realIO(double)} + * @pre $none + * @post $result >= 0.0 + */ + public double real_io(double value) { + return this.realIO(value); + } + + /** + * Gets the I/O real number based on a given value + * @param value the specified value + * @return real number + * @pre $none + * @post $result >= 0.0 + */ + public double realIO(double value) { + return GridSimRandom.realIO(value); + } + + /** + * A method that gets one process event at one time until the end + * of a simulation, then delivers an event to the entity (its parent) + * @pre $none + * @post $none + */ + public void body() + { + // find out ids for entities that are not part of simulation network + // topology, such as GIS, GridSimShutdown and GridStatistics + int gisID = GridSim.getGridInfoServiceEntityId(); + int statID = GridSim.getGridStatisticsEntityId(); + int shutdownID = GridSim.getGridSimShutdownEntityId(); + + // start generating some junk packets or background traffic + startBackgroundTraffic(); + + // Process incoming events + while ( Sim_system.running() ) + { + Sim_event ev = new Sim_event(); + super.sim_get_next(ev); // get the next event in the queue + + // if the simulation finishes then exit the loop + if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) { + break; + } + + System.out.println(super.get_name() + ".body(): ev.get_tag() is " + ev.get_tag()); + System.out.println(super.get_name() + ".body(): ev.get_src() is " + ev.get_src()); + + // handle different types of incoming events + switch ( ev.get_tag() ) + { + case GridSimTags.SEND_PACKET: + sendPacket(); + break; + + // submit ping() request + case GridSimTags.INFOPKT_SUBMIT: + sendInfoPacket(ev); + break; + + // replying ping() request from another entity + case GridSimTags.INFOPKT_RETURN: + returnInfoPacket(ev); + break; + + // activate background traffic + case GridSimTags.JUNK_PKT: + generateBackgroundTraffic(); + break; + + default: + defaultSend(ev, gisID, statID, shutdownID); + break; + } + } + } + + /** + * Generates few junk flows at the given interval + * @pre $none + * @post $none + */ + private synchronized void generateBackgroundTraffic() + { + + // get the next inter-arrival time for these junk packets + long time = gen_.getNextPacketTime(); + + // get the sending pattern + int pattern = gen_.getPattern(); + + // for initial start-up, get the list of all resources first + if (hasStarted_ == false) + { + // get list of resource IDs from GIS + LinkedList resList = GridSim.getGridResourceList(); + + // if the list is empty then schedule the next time + if (resList == null && list_.size() == 0) + { + super.sim_schedule(super.get_id(), time, GridSimTags.JUNK_PKT); + return; + } + + hasStarted_ = true; + list_.addAll(resList); // add resource IDs into the current list + + // sets the sending pattern + if (pattern == TrafficGenerator.SEND_ONE_ONLY && random_ == null) { + random_ = new Random(); + } + } + + // get the required info for generating this background traffic + long size = gen_.getNextPacketSize(); // packet size + long freq = gen_.getNextPacketFreq(); // packet freq + int type = gen_.getServiceType(); // packet type + int tag = GridSimTags.JUNK_PKT; // packet tag + + + /********* // DEBUG info + System.out.println(); + System.out.println(super.get_name() + + ": START GENERATE BG traffic... at time "+ GridSim.clock()); + System.out.println(super.get_name() + + ": NEXT background traffic will start at " + time); + System.out.println(super.get_name() + + " num PACKETS = " + numPackets + ", freq = " + freq); + *********/ + + int i = 0; + int destId = -1; + + // send to one of the entity using uniform distribution + if (pattern == TrafficGenerator.SEND_ONE_ONLY) + { + int index = random_.nextInt( list_.size() ); + destId = ((Integer) list_.get(index)).intValue(); + + /********* // DEBUG info + System.out.println(super.get_name() + ": Destination id = " + + destId + " = " + GridSim.getEntityName(destId) ); + *********/ + + convertIntoPacket(size, 1, tag, destId, type); + + + } + // send to all resources + other entities + else if (pattern == TrafficGenerator.SEND_ALL) + { + // send to all resources and user entities + for (int k = 0; k < list_.size(); k++) + { + destId = ((Integer) list_.get(k)).intValue(); + + /********* // DEBUG info + System.out.println(super.get_name() + ": Destination id = " + + destId + " = " + GridSim.getEntityName(destId) ); + *********/ + + convertIntoPacket(size, 1, tag, destId, type); + + } + } + + // sends the next junk packets + super.sim_schedule(super.get_id(), time, GridSimTags.JUNK_PKT); + } + + /** + * Initial start for the background traffic + * @pre $none + * @post $none + */ + private synchronized void startBackgroundTraffic() + { + // if no background traffic generator, then skip the rest + if (gen_ == null) { + return; + } + + // get the next inter-arrival time + long time = gen_.getNextPacketTime(); + System.out.println(super.get_name() + + ": background traffic will start at time " + time); + + // starts background traffic if the inter-arrival time is valid + if (time == -1) { + return; + } + + super.sim_schedule(super.get_id(), time, GridSimTags.JUNK_PKT); + } + + /** + * This method processes outgoing data without a network extension. + * @param ev a Sim_event object + * @param gisID the central/default GIS entity ID + * @param statID the GridStatistic entity ID + * @param shutdownID the GridSimShutdown entity ID + * @pre ev != null + * @post $none + */ + private synchronized void defaultSend(Sim_event ev, int gisID, int statID, + int shutdownID) + { + IO_data io = (IO_data) ev.get_data(); + int destId = io.getDestID(); + + /***** // DEBUG info + System.out.println(super.get_name() + ".defaultSend(): Send to " + + GridSim.getEntityName(destId) + " tag = " + ev.get_tag() + " at time = " + GridSim.clock()); + /*****/ + + // if this entity uses a network extension + if (link_ != null && destId != gisID && destId != statID && + destId != shutdownID) + { + System.out.println(super.get_name() + ".defaultSend(): submitToLink() + at time = " + GridSim.clock()); + submitToLink(ev); + return; + } + + // Identify ID of an entity which acts as Input/Buffer + // entity of destination entity + int id = GridSim.getEntityId( "Input_" + + Sim_system.get_entity(destId).get_name() ); + + // Send first and then hold + super.sim_schedule(id, GridSimTags.SCHEDULE_NOW, ev.get_tag(), io); + + double receiverBaudRate = ( (FlowInput) + Sim_system.get_entity(id) ).getBaudRate(); + + // NOTE: io is in byte and baud rate is in bits. 1 byte = 8 bits + // So, convert io into bits + double minBaudRate = Math.min(baudRate_, receiverBaudRate); + double communicationDelay = GridSimRandom.realIO( + (io.getByteSize() * BITS) / minBaudRate); + + // NOTE: Below is a deprecated method for SimJava 2 + //super.sim_hold(communicationDelay); + super.sim_process(communicationDelay); + } + + /** + * This method takes data from an entity. The data is encapsulated in a single FlowPacket. + * After this it calls enque() to queue these flows into its + * buffer. + * + * @param ev A Sim_event data that contains all the data for this method + * to do its task. + * @pre ev != null + * @post $none + */ + private synchronized void submitToLink(Sim_event ev) + { + IO_data data = (IO_data) ev.get_data(); + Object obj = data.getData(); + long size = data.getByteSize(); + int tag = ev.get_tag(); + int destId = data.getDestID(); + int netServiceType = data.getNetServiceLevel(); + + // last packet contains the actual data + FlowPacket np = null; + np = new FlowPacket(obj,rnd.nextInt(Integer.MAX_VALUE),size,tag,super.get_id... [truncated message content] |
From: <aca...@us...> - 2008-07-29 14:33:37
|
Revision: 192 http://gridsim.svn.sourceforge.net/gridsim/?rev=192&view=rev Author: acaminero Date: 2008-07-29 14:33:45 +0000 (Tue, 29 Jul 2008) Log Message: ----------- to allow future extensions (drop other things than files and gridlets) Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/GridSimTags.java Modified: branches/gridsim4.0-branch2/source/gridsim/GridSimTags.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/GridSimTags.java 2008-07-29 14:28:46 UTC (rev 191) +++ branches/gridsim4.0-branch2/source/gridsim/GridSimTags.java 2008-07-29 14:33:45 UTC (rev 192) @@ -302,6 +302,22 @@ /**This is to update the parameters of ARED*/ public static final int FNB_UPDATE_ARED_PARAMETERS = BASE + 37; + + /**This is to simulate the finite buffers. This constant is used when an Output + * port tells a user that a file has failed because at least of his packets + * has been dropped*/ + public static final int FNB_FILE_FAILED_BECAUSE_PACKET_DROPPED = BASE + 38; + + /**This is to simulate the finite buffers. This constant is used when an Output + * port tells a user that a file and a gridlet have failed because at least of his packets + * has been dropped*/ + public static final int FNB_FILE_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED = BASE + 39; + + + /**This is to identify when a packet contains a file*/ + public static final int FNB_PKT_CONTAINS_FILE = BASE + 999; + + /**This is to update the parameters of ARED. The time period between updates (0.5 seconds)*/ public static final double FNB_UPDATE_ARED_PARAMETERS_PERIOD = 0.5; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2008-07-29 14:28:38
|
Revision: 191 http://gridsim.svn.sourceforge.net/gridsim/?rev=191&view=rev Author: acaminero Date: 2008-07-29 14:28:46 +0000 (Tue, 29 Jul 2008) Log Message: ----------- to allow future extensions (drop other things than files and gridlets) Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/datagrid/DataGridUser.java Modified: branches/gridsim4.0-branch2/source/gridsim/datagrid/DataGridUser.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/datagrid/DataGridUser.java 2008-07-29 14:27:35 UTC (rev 190) +++ branches/gridsim4.0-branch2/source/gridsim/datagrid/DataGridUser.java 2008-07-29 14:28:46 UTC (rev 191) @@ -3,6 +3,11 @@ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * + * + * Modified: + * - addMaster(..) */ package gridsim.datagrid; @@ -12,6 +17,7 @@ import gridsim.net.Link; import gridsim.datagrid.filter.*; import java.util.*; +import gridsim.net.fnb.*; /** @@ -19,11 +25,12 @@ * @author Uros Cibej and Anthony Sulistio * @since GridSim Toolkit 4.0 */ -public class DataGridUser extends GridUser { +public class DataGridUser extends GridUser +{ - private String rcName_; // replica catalogue name - private int rcID_; // replica catalogue ID - private Integer myID_; // this entity ID + private String rcName_; // replica catalogue name + private int rcID_; // replica catalogue ID + private Integer myID_; // this entity ID /** @@ -55,8 +62,8 @@ * @see gridsim.datagrid.DataGridUser#setReplicaCatalogue(String) * @see gridsim.datagrid.DataGridUser#setReplicaCatalogue(AbstractRC) */ - public DataGridUser(String name, Link link, String regionalGIS) - throws Exception + public DataGridUser(String name, Link link, String regionalGIS) throws + Exception { super(name, link, regionalGIS); init(); @@ -67,7 +74,7 @@ { rcName_ = null; rcID_ = -1; - myID_ = new Integer( super.get_id() ); + myID_ = new Integer(super.get_id()); } /** @@ -83,12 +90,13 @@ { super(name, link, regionalGIS); rcID_ = GridSim.getEntityId(rcName); - if (rcName == null || rcID_ == -1) { + if (rcName == null || rcID_ == -1) + { throw new Exception(name + ": Error - invalid RC name"); } rcName_ = rcName; - myID_ = new Integer( super.get_id() ); + myID_ = new Integer(super.get_id()); } /** @@ -100,7 +108,8 @@ public boolean setReplicaCatalogue(String rcName) { int id = GridSim.getEntityId(rcName); - if (rcName == null || id == -1) { + if (rcName == null || id == -1) + { return false; } rcName_ = rcName; @@ -116,10 +125,11 @@ */ public boolean setReplicaCatalogue(AbstractRC rc) { - if (rc == null) { + if (rc == null) + { return false; } - return setReplicaCatalogue( rc.get_name() ); + return setReplicaCatalogue(rc.get_name()); } /** @@ -142,9 +152,9 @@ if (rcID_ == -1) { result = false; - rcName_ = null; // change the RC name to null + rcName_ = null; // change the RC name to null System.out.println(super.get_name() + - ": Error - no TopRegionalRC entity exists."); + ": Error - no TopRegionalRC entity exists."); } } @@ -177,7 +187,8 @@ * @return a list of local RC IDs in <tt>Integer</tt> object * or <tt>null</tt> if RCs do not exist. */ - public Object[] getLocalRCList() { + public Object[] getLocalRCList() + { return super.getList(DataGridTags.INQUIRY_LOCAL_RC_LIST); } @@ -188,7 +199,8 @@ * @return a list of global RC IDs in <tt>Integer</tt> object * or <tt>null</tt> if RCs do not exist. */ - public Object[] getGlobalRCList() { + public Object[] getGlobalRCList() + { return super.getList(DataGridTags.INQUIRY_GLOBAL_RC_LIST); } @@ -204,16 +216,18 @@ */ public int getReplicaLocation(String lfn) { - if (lfn == null) { + if (lfn == null) + { return -1; } int resourceID = -1; - int eventTag = DataGridTags.CTLG_GET_REPLICA; // set tag name + int eventTag = DataGridTags.CTLG_GET_REPLICA; // set tag name // consult with the RC first int rcID = getReplicaCatalogueID(); - if (rcID == -1) { + if (rcID == -1) + { return -1; } @@ -221,28 +235,60 @@ sendEvent(eventTag, lfn, rcID); // waiting for a response from the RC - Sim_type_p tag = new Sim_type_p(DataGridTags.CTLG_REPLICA_DELIVERY); + while (Sim_system.running()) + { + Sim_event ev = new Sim_event(); + super.sim_get_next(ev); // get the next event in the queue - // only look for this type of ack - Sim_event ev = new Sim_event(); - super.sim_get_next(tag, ev); + switch (ev.get_tag()) + { + // if everything works fine + case DataGridTags.CTLG_REPLICA_DELIVERY: + try + { + Object[] data = (Object[]) ev.get_data(); // get the data + Integer resID = (Integer) data[1]; // get the resource ID + if (resID != null) + { + resourceID = resID.intValue(); + } + } catch (Exception e) + { + resourceID = -1; + System.out.println(super.get_name() + + ".getReplicaLocation(): Exception"); + } - try - { - Object[] data = (Object[]) ev.get_data(); // get the data - Integer resID = (Integer) data[1]; // get the resource ID - if (resID != null) { - resourceID = resID.intValue(); - } - } - catch (Exception e) - { - resourceID = -1; - System.out.println(super.get_name() - + ".getReplicaLocation(): Exception"); - } + return resourceID; - return resourceID; + // if there is a dropped pkt + case GridSimTags.FNB_FILE_FAILED_BECAUSE_PACKET_DROPPED: + + // check that this event is for the current file + FnbMessageDropFile msgDropGl = ((FnbMessageDropFile)ev.get_data()); + + String filename = msgDropGl.getFilename(); + + System.out.println(super.get_name() + + ".getReplicaLocation(): FNB_FILE_FAILED_BECAUSE_PACKET_DROPPED." + + " filename: " + filename); + + if (filename.compareTo(lfn) == 0) + { + // the file we are wating for has been dropped + return -1; + + } + // keep waiting + break; + + } //switch (ev.get_tag()) + + } // while (Sim_system.running()) + + return -1; + + } /** @@ -268,7 +314,8 @@ */ public List getReplicaLocationList(String lfn, int rcID) { - if (lfn == null || rcID == -1) { + if (lfn == null || rcID == -1) + { return null; } @@ -277,23 +324,22 @@ sendEvent(eventTag, lfn, rcID); // waiting for a response from the RC - Sim_type_p tag =new Sim_type_p(DataGridTags.CTLG_REPLICA_LIST_DELIVERY); + Sim_type_p tag = new Sim_type_p(DataGridTags.CTLG_REPLICA_LIST_DELIVERY); // only look for this type of ack Sim_event ev = new Sim_event(); super.sim_get_next(tag, ev); - List resList = null; // a list of resource IDs storing lfn + List resList = null; // a list of resource IDs storing lfn try { - Object[] data = (Object[]) ev.get_data(); // get the data - resList = (List) data[1]; // get the resource list - } - catch (Exception e) + Object[] data = (Object[]) ev.get_data(); // get the data + resList = (List) data[1]; // get the resource list + } catch (Exception e) { resList = null; System.out.println(super.get_name() - + ".getReplicaLocationList(): Exception."); + + ".getReplicaLocationList(): Exception."); } return resList; @@ -308,7 +354,8 @@ { // check first int rcID = getReplicaCatalogueID(); - if (rcID == -1 || lfn == null) { + if (rcID == -1 || lfn == null) + { return null; } @@ -325,14 +372,14 @@ Sim_event ev = new Sim_event(); super.sim_get_next(tag, ev); - try { + try + { fAttr = (FileAttribute) ev.get_data(); - } - catch (Exception e) + } catch (Exception e) { fAttr = null; System.out.println(super.get_name() - + ".getFileAttribute(): Exception"); + + ".getFileAttribute(): Exception"); } return fAttr; } @@ -345,7 +392,8 @@ */ public boolean addMaster(File file, int resID) { - if (file == null || resID == -1) { + if (file == null || resID == -1) + { return false; } @@ -354,39 +402,89 @@ packet[0] = file; packet[1] = myID_; + int fileID = file.getRegistrationID(); + //System.out.println(super.get_name() + ": addMaster. FileID: " + fileID + ". FileName: " + file.getName() ); + int tag = DataGridTags.FILE_ADD_MASTER; - super.send(super.output, 0.0, tag, new IO_data(packet,fileSize,resID)); + super.send(super.output, 0.0, tag, new IO_data(packet, fileSize, resID)); // wait for the result back - tag = DataGridTags.FILE_ADD_MASTER_RESULT; - FilterDataResult type = new FilterDataResult(file.getName(), tag); - Sim_event ev = new Sim_event(); - super.sim_get_next(type, ev); + //tag = DataGridTags.FILE_ADD_MASTER_RESULT; - boolean result = false; - try + //FilterDataResult type = new FilterDataResult(file.getName(), tag); + + while (Sim_system.running()) { - packet = (Object[]) ev.get_data(); // get the data - String resName = GridSim.getEntityName(resID); // resource name - int msg = ((Integer) packet[2]).intValue(); // get the result - if (msg == DataGridTags.FILE_ADD_SUCCESSFUL) + Sim_event ev = new Sim_event(); + super.sim_get_next(ev); // get the next event in the queue + + switch (ev.get_tag()) { - result = true; - System.out.println(super.get_name() + ".addMaster(): " + - file.getName() + " has been added to " + resName); - } - else { - System.out.println(super.get_name() + ".addMaster(): " + - "Error in adding " + file.getName() + " to " + resName); - } - } - catch (Exception e) - { - result = false; - System.out.println(super.get_name() + ".addMaster(): Exception"); - } + // if everything works fine + case DataGridTags.FILE_ADD_MASTER_RESULT: - return result; + boolean result = false; + try + { + packet = (Object[]) ev.get_data(); // get the data + String resName = GridSim.getEntityName(resID); // resource name + int msg = ((Integer) packet[2]).intValue(); // get the result + if (msg == DataGridTags.FILE_ADD_SUCCESSFUL) + { + result = true; + fileID = file.getRegistrationID(); + + System.out.println(super.get_name() + + ".addMaster(): " + + file.getName() + + " has been added to " + resName + + ". FileID: " + fileID); + } + else + { + System.out.println(super.get_name() + + ".addMaster(): " + + "Error in adding " + + file.getName() + " to " + + resName); + } + } catch (Exception e) + { + result = false; + System.out.println(super.get_name() + + ".addMaster(): Exception"); + } + + return result; + + // if there is a dropped pkt + case GridSimTags.FNB_FILE_FAILED_BECAUSE_PACKET_DROPPED: + + // check that this event is for the current file + FnbMessageDropFile msgDropGl = ((FnbMessageDropFile)ev.get_data()); + + String filename = msgDropGl.getFilename(); + + System.out.println(super.get_name() + + ".addMaster(): FNB_FILE_FAILED_BECAUSE_PACKET_DROPPED." + + " filename: " + filename); + + if (filename.compareTo(file.getName()) == 0) + { + // the file we are wating for has been dropped + return false; + + } + + // keep waiting + break; + + } //switch (ev.get_tag()) + + } // while (Sim_system.running()) + + return false; + } /** @@ -398,12 +496,13 @@ public boolean replicateFile(File master, int resID) { // check for errors first - if (master == null || resID == -1) { + if (master == null || resID == -1) + { return false; } - File file = master.makeReplica(); // makes a replica of this file - int fileSize = file.getSizeInByte(); // size of the replica file + File file = master.makeReplica(); // makes a replica of this file + int fileSize = file.getSizeInByte(); // size of the replica file Object[] packet = new Object[2]; packet[0] = file; packet[1] = myID_; @@ -429,16 +528,19 @@ { result = true; System.out.println(super.get_name() + ".replicateFile(): " + - filename + " has been replicated to " + resName); + filename + " has been replicated to " + + resName); } - else { + else + { System.out.println(super.get_name() + ".replicateFile(): " + - "There was an error in replicating " + filename + - " to " + resName); + "There was an error in replicating " + + filename + + " to " + resName); } - } - catch (Exception e) { - System.out.println(super.get_name()+".replicateFile(): Exception"); + } catch (Exception e) + { + System.out.println(super.get_name() + ".replicateFile(): Exception"); result = false; } @@ -454,7 +556,8 @@ public boolean deleteFile(String filename, int resID) { // check for errors first - if (resID == -1 || filename == null) { + if (resID == -1 || filename == null) + { return false; } @@ -478,19 +581,22 @@ packet = (Object[]) ev.get_data(); String resName = GridSim.getEntityName(resID); int msg = ((Integer) packet[1]).intValue(); - if (msg == DataGridTags.FILE_DELETE_SUCCESSFUL) { + if (msg == DataGridTags.FILE_DELETE_SUCCESSFUL) + { result = true; System.out.println(super.get_name() + ".deleteFile(): " + - filename + " has been deleted from " + resName); + filename + " has been deleted from " + + resName); } - else { + else + { System.out.println(super.get_name() + ".deleteFile(): " + - "There was an error in deleting " + filename + - " from " + resName); + "There was an error in deleting " + filename + + " from " + resName); } - } - catch (Exception e) { + } catch (Exception e) + { System.out.println(super.get_name() + ".deleteFile(): Exception"); result = false; } @@ -506,7 +612,8 @@ public boolean deleteMaster(String filename, int resID) { // check for errors first - if (resID == -1 || filename == null) { + if (resID == -1 || filename == null) + { return false; } @@ -530,27 +637,29 @@ packet = (Object[]) ev.get_data(); String resName = GridSim.getEntityName(resID); int msg = ((Integer) packet[1]).intValue(); - if (msg == DataGridTags.FILE_DELETE_SUCCESSFUL) { + if (msg == DataGridTags.FILE_DELETE_SUCCESSFUL) + { result = true; System.out.println(super.get_name() + ".deleteMaster(): " + - filename + " has been deleted from " + resName); + filename + " has been deleted from " + + resName); } - else { + else + { System.out.println(super.get_name() + ".deleteMaster(): " + - "There was an error in deleting " + filename + - " from " + resName); + "There was an error in deleting " + filename + + " from " + resName); } - } - catch (Exception e) { + } catch (Exception e) + { System.out.println(super.get_name() + ".masterFile(): Exception"); result = false; } return result; } - - + /** * Gets a list of file attributes from a given filter * @param filter a filtering function @@ -560,7 +669,8 @@ { // check for errors first int rcID = getReplicaCatalogueID(); - if (filter == null || rcID == -1) { + if (filter == null || rcID == -1) + { return null; } @@ -577,15 +687,16 @@ // waiting for a response from the RC Sim_type_p tag = new Sim_type_p(DataGridTags.CTLG_FILTER_DELIVERY); Sim_event ev = new Sim_event(); - super.sim_get_next(tag, ev); // only look for this type of ack + super.sim_get_next(tag, ev); // only look for this type of ack - try { + try + { attrList = (ArrayList) ev.get_data(); - } - catch (Exception e) { + } catch (Exception e) + { attrList = null; System.out.println(super.get_name() + - ".getAttributeList(): Exception"); + ".getAttributeList(): Exception"); } return attrList; } @@ -598,7 +709,8 @@ */ public File getFile(String lfn, int resID) { - if (lfn == null || resID == -1) { + if (lfn == null || resID == -1) + { return null; } @@ -609,13 +721,14 @@ // waiting for a response from the resource Sim_type_p tag = new Sim_type_p(DataGridTags.FILE_DELIVERY); Sim_event ev = new Sim_event(); - super.sim_get_next(tag, ev); // only look for this type of ack + super.sim_get_next(tag, ev); // only look for this type of ack File file = null; - try { + try + { file = (File) ev.get_data(); - } - catch (Exception e) { + } catch (Exception e) + { file = null; System.out.println(super.get_name() + ".getFile(): Exception"); } @@ -636,7 +749,8 @@ public String getFullFilename(String filename) { ArrayList list = getAttributeList(new FileNameFilter(filename)); - if (list != null && list.size() > 0) { + if (list != null && list.size() > 0) + { FileAttribute att = (FileAttribute) list.get(0); return att.getName(); } @@ -652,7 +766,8 @@ private void sendEvent(int eventTag, String lfn, int resID) { int size = lfn.length(); - if (size < DataGridTags.PKT_SIZE) { + if (size < DataGridTags.PKT_SIZE) + { size = DataGridTags.PKT_SIZE; } Object[] packet = new Object[2]; @@ -660,7 +775,7 @@ packet[1] = myID_; // send a message - super.send(super.output, 0, eventTag, new IO_data(packet,size,resID)); + super.send(super.output, 0, eventTag, new IO_data(packet, size, resID)); } } // end class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2008-07-29 14:27:26
|
Revision: 190 http://gridsim.svn.sourceforge.net/gridsim/?rev=190&view=rev Author: acaminero Date: 2008-07-29 14:27:35 +0000 (Tue, 29 Jul 2008) Log Message: ----------- to allow future extensions (drop other things than files and gridlets) Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java 2008-07-29 14:25:19 UTC (rev 189) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java 2008-07-29 14:27:35 UTC (rev 190) @@ -323,19 +323,36 @@ int pkt_dropped_id = userPkt.getPkt(); int user_id = userPkt.getUser(); - Fnb_failed_gridlet_file fglf = lookForGridlet(pkt_dropped_id); - int glID = fglf.getEntityID(); + FnbMessage msgDrop = lookForEntity(pkt_dropped_id); - if (glID != 9999) + int glID; + if (msgDrop != null) { - // Tell the user that the gridlet is failed because of the dropping of a packet - super.sim_schedule(user_id, GridSimTags.SCHEDULE_NOW, - GridSimTags.FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED, fglf); + glID = msgDrop.getEntityID(); + + if (glID != 9999) + { + // Check if it is a file or a gridlet + if (msgDrop instanceof FnbMessageDropFile) + { + // Tell the user that the file is failed because of the dropping of a packet + super.sim_schedule(user_id, GridSimTags.SCHEDULE_NOW, + GridSimTags. + FNB_FILE_FAILED_BECAUSE_PACKET_DROPPED, + msgDrop); + } + else if (msgDrop instanceof FnbMessageDropGridlet) + { + // Tell the user that the gridlet is failed because of the dropping of a packet + super.sim_schedule(user_id, GridSimTags.SCHEDULE_NOW, + GridSimTags. + FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED, + msgDrop); + } + } + ev = null; // new, to call the garbage collector } - ev = null; // new, to call the garbage collector - - } @@ -996,9 +1013,9 @@ * @param pkt the ID of the packet of interest * @return a Fnb_failed_gridlet_file object, containing the entity (gridlet/file) ID, and if the entity is a file * */ - Fnb_failed_gridlet_file lookForGridlet(int pktID) + FnbMessage lookForEntity(int pktID) { - Fnb_failed_gridlet_file fglfile = new Fnb_failed_gridlet_file(9999, false); + FnbMessage msgDrop = null; // = new FnbMessage(9999, false); for (int i = 0; i < packetsGridletsList_.size(); i++) { firstLastPacketsGridlet flPktGl = (firstLastPacketsGridlet) @@ -1006,20 +1023,20 @@ if ((flPktGl.getFirst() <= pktID) && (flPktGl.getLast() > pktID)) { - fglfile.setEntityID(flPktGl.getGridletID()); - fglfile.setIsFile(flPktGl.getIsFile()); + if (flPktGl.getIsFile()) + msgDrop = new FnbMessageDropFile(flPktGl.getGridletID() , getFilename(flPktGl.getGridletID())); + else + msgDrop = new FnbMessageDropGridlet(flPktGl.getGridletID()); - fglfile.setFilename(getFilename(fglfile.getEntityID())); - - /*System.out.println(super.get_name() + ": lookForGridlet: entiyID: " + + System.out.println(super.get_name() + ": lookForEntity: entiyID: " + flPktGl.getGridletID() + ". isFile " + flPktGl.getIsFile() + - ". filename " + getFilename(fglfile.getEntityID()));*/ + ". filename " + getFilename(msgDrop.getEntityID())); - return fglfile; + return msgDrop; } } - return fglfile;// if there is no gridlet, return this + return msgDrop;// if there is no entity, return this } } // end class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2008-07-29 14:25:11
|
Revision: 189 http://gridsim.svn.sourceforge.net/gridsim/?rev=189&view=rev Author: acaminero Date: 2008-07-29 14:25:19 +0000 (Tue, 29 Jul 2008) Log Message: ----------- to allow future extensions (drop other things than files and gridlets) Added Paths: ----------- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessage.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessageDropFile.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessageDropGridlet.java Added: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessage.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessage.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessage.java 2008-07-29 14:25:19 UTC (rev 189) @@ -0,0 +1,9 @@ +package gridsim.net.fnb; + +public interface FnbMessage +{ + public void setEntityID(int i); + + public int getEntityID(); + +} Added: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessageDropFile.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessageDropFile.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessageDropFile.java 2008-07-29 14:25:19 UTC (rev 189) @@ -0,0 +1,38 @@ +package gridsim.net.fnb; + +import gridsim.net.fnb.*; + +public class FnbMessageDropFile implements FnbMessage +{ + int fileID; + String filename; + + public FnbMessageDropFile(int e, String f) + { + fileID = e; + filename = f; + } + + public void setEntityID(int i) + { + fileID = i; + } + + + public int getEntityID() + { + return fileID; + } + + public void setFilename(String f) + { + filename = f; + } + + public String getFilename() + { + return filename; + } + + +} Added: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessageDropGridlet.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessageDropGridlet.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbMessageDropGridlet.java 2008-07-29 14:25:19 UTC (rev 189) @@ -0,0 +1,26 @@ +package gridsim.net.fnb; + +import gridsim.net.fnb.*; + +public class FnbMessageDropGridlet implements FnbMessage +{ + int gridletID; + + public FnbMessageDropGridlet (int e) + { + gridletID = e; + } + + public void setEntityID(int i) + { + gridletID = i; + } + + + public int getEntityID() + { + return gridletID; + } + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2008-07-22 09:44:27
|
Revision: 188 http://gridsim.svn.sourceforge.net/gridsim/?rev=188&view=rev Author: acaminero Date: 2008-07-22 09:44:36 +0000 (Tue, 22 Jul 2008) Log Message: ----------- Examples for the finite buffers extension Added Paths: ----------- branches/gridsim4.0-branch2/source/gridsim/fnbExample/ branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletExample_main.java branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletUser.java branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletUser_2.java branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbUser.java branches/gridsim4.0-branch2/source/gridsim/fnbExample/GridletSubmission.java branches/gridsim4.0-branch2/source/gridsim/fnbExample/mainExample.java Added: branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletExample_main.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletExample_main.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletExample_main.java 2008-07-22 09:44:36 UTC (rev 188) @@ -0,0 +1,289 @@ +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + */ + +package gridsim.fnbExample; + +import gridsim.*; +import gridsim.datagrid.*; +import gridsim.datagrid.index.DataGIS; +import gridsim.datagrid.index.TopRegionalRC; +import gridsim.datagrid.storage.HarddriveStorage; +import gridsim.datagrid.storage.Storage; +import gridsim.net.FIFOScheduler; +import gridsim.net.Link; +import gridsim.net.RIPRouter; +import gridsim.net.Router; +import gridsim.net.SimpleLink; +import gridsim.net.fnb.*; + + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.LinkedList; + + +/** + * This example demonstates the usage of DataGridlets in simulations. This class + * initializes all the entities, which are the same as in the other datagrid + * examples. The DataGridlet management is implemented in the class GridletUser. + * + * @author Uros Cibej and Anthony Sulistio + */ +public class FnbDataGridletExample_main { + public static void main(String[] args) { + + DataGIS gis = null; + TopRegionalRC rc = null; + DataGridUser user = null; + + int max_buffer_size = 1500; + int min_th = 466; + int max_th = 1400; + + // FIRST STEP--------------------------------------------- + // Initialize the GridSim package + int num_user = 1; // number of grid users + Calendar calendar = Calendar.getInstance(); + boolean trace_flag = false; // means trace GridSim events + boolean gisFlag = false; // means using DataGIS instead + GridSim.init(num_user, calendar, trace_flag, gisFlag); + + int totalUser = 15; + int totalResource = 5; + int total_gl = totalResource; + + //GridSim.init(NUM_USER, calendar, trace_flag); + GridSim.initNetworkType(GridSimTags.NET_BUFFER_PACKET_LEVEL); + + // set the GIS into DataGIS that handles specifically for data grid + // scenarios + try { + gis = new DataGIS(); + GridSim.setGIS(gis); + } catch (Exception e) { + e.printStackTrace(); + } + + // SECOND STEP--------------------------------------------- + // Create a top level Replica Catalogue + double baud_rate = 1000000000; // bits/sec + double propDelay = 10; // propagation delay in millisecond + int mtu = 1500; // max. transmission unit in byte + try { + SimpleLink l = new SimpleLink("rc_link", baud_rate, propDelay, mtu); + rc = new TopRegionalRC(l); + } catch (Exception e1) { + e1.printStackTrace(); + } + + // THIRD STEP--------------------------------------------- + // Create resources + int i = 0; + + ArrayList resList = new ArrayList(totalResource); + for (i = 0; i < totalResource; i++) { + DataGridResource res = createGridResource("Res_" + i, baud_rate, + propDelay, mtu); + resList.add(res); + } + + // FOURTH STEP--------------------------------------------- + // Create user(s) + try { + + for (i = 0; i < totalUser; i++) { + // To try a different examen, change the user class. + /* user = new FnbDataGridletUser("SIM_0_User_" + i, baud_rate, + propDelay, mtu, total_gl);*/ + + user = new FnbDataGridletUser_2("SIM_0_User_" + i, baud_rate, + propDelay, mtu); + user.setReplicaCatalogue(TopRegionalRC.DEFAULT_NAME); + } + } catch (Exception e2) { + e2.printStackTrace(); + } + + // FIFTH STEP--------------------------------------------- + // Create network + FnbRouter r1 = new FnbRIPRouter("router1", 1); // router 1 + FnbRouter r2 = new FnbRIPRouter("router2", 2); // router 2 + + try { + // connect the routers + baud_rate = 10000; + Link link = new SimpleLink("r1_r2_link", baud_rate, propDelay, mtu); + RED r1Sched = new RED("r1Sched", baud_rate, max_buffer_size, min_th, max_th, 0.003, 0.2, false); + RED r2Sched = new RED("r2Sched", baud_rate, max_buffer_size, min_th, max_th, 0.003, 0.2, false); + + // attach r2 to r1 + r1.attachRouter(r2, link, r1Sched, r2Sched); + } catch (Exception e3) + { + e3.printStackTrace(); + } + + // FIFTH STEP--------------------------------------------- + // Connect resources, users and catalogues to the network + + try + { + // connect resources + GridResource resObj = null; + for (i = 0; i < resList.size(); i++) + { + RED resSched = new RED("resSched_" +i, baud_rate, max_buffer_size, min_th, max_th, + 0.003, 0.2, false); + resObj = (GridResource) resList.get(i); + r2.attachHost(resObj, resSched); // attach the resource to router r2 + } + // connect user + RED userSched = new RED("userSched", baud_rate, max_buffer_size, min_th, max_th, + 0.003, 0.2, false); + r1.attachHost(user, userSched); // atach the user to router r1 + + // connect rc + RED rcSched = new RED("rcSched", baud_rate, 200, min_th, max_th, + 0.003, 0.2, false); + r2.attachHost(rc, rcSched); // attach RC + + } catch (Exception e4) // (ParameterException e4) + { + e4.printStackTrace(); + } + + // SIXTH STEP--------------------------------------------- + // Finally start the simulation + + + System.out.println("---- fnbWhiteList_ ---"); + for (int w = 0; w < GridSim.fnbWhiteList_.size(); w++) + { + System.out.println(GridSim.getEntityName(GridSim.fnbWhiteList_.get(w). + intValue())); + } + System.out.println("-------"); + + GridSim.startGridSimulation(); + + System.out.println("\n FINISH ..."); + } + + private static DataGridResource createGridResource(String name, + double baud_rate, double delay, int MTU) { + System.out.println(); + System.out.println("Starting to create one Grid resource with " + + "3 Machines"); + + // Here are the steps needed to create a Grid resource: + // 1. We need to create an object of MachineList to store one or more + // Machines + MachineList mList = new MachineList(); + + // 2. A Machine contains one or more PEs or CPUs. Therefore, should + // create an object of PEList to store these PEs before creating + // a Machine. + PEList peList1 = new PEList(); + + // 3. Create PEs and add these into an object of PEList. + // In this example, we are using a resource from + // hpc420.hpcc.jp, AIST, Tokyo, Japan + // Note: these data are taken the from GridSim paper, page 25. + // In this example, all PEs has the same MIPS (Millions + // Instruction Per Second) Rating for a Machine. + peList1.add(new PE(0, 377)); // need to store PE id and MIPS Rating + peList1.add(new PE(1, 377)); + peList1.add(new PE(2, 377)); + peList1.add(new PE(3, 377)); + + // 4. Create one Machine with its id and list of PEs or CPUs + mList.add(new Machine(0, peList1)); // First Machine + + // 5. Repeat the process from 2 if we want to create more Machines + // In this example, the AIST in Japan has 3 Machines with same + // MIPS Rating but different PEs. + // NOTE: if you only want to create one Machine for one Grid resource, + // then you could skip this step. + PEList peList2 = new PEList(); + + peList2.add(new PE(0, 377)); + peList2.add(new PE(1, 377)); + peList2.add(new PE(2, 377)); + peList2.add(new PE(3, 377)); + + mList.add(new Machine(1, peList2)); // Second Machine + + PEList peList3 = new PEList(); + // System.out.println("Creates a PE list for the 3rd Machine"); + + peList3.add(new PE(0, 377)); + peList3.add(new PE(1, 377)); + + mList.add(new Machine(2, peList3)); // Third Machine + + // 6. Create a ResourceCharacteristics object that stores the + // properties of a Grid resource: architecture, OS, list of + // Machines, allocation policy: time- or space-shared, time zone + // and its price (G$/PE time unit). + String arch = "Sun Ultra"; // system architecture + String os = "Solaris"; // operating system + double time_zone = 9.0; // time zone this resource located + double cost = 3.0; // the cost of using this resource + + ResourceCharacteristics resConfig = new ResourceCharacteristics(arch, + os, mList, ResourceCharacteristics.TIME_SHARED, time_zone, cost); + + // System.out.println("Creates the properties of a Grid resource and " + + // "stores the Machine list"); + + // 7. Finally, we need to create a GridResource object. + long seed = 11L * 13 * 17 * 19 * 23 + 1; + double peakLoad = 0.0; // the resource load during peak hour + double offPeakLoad = 0.0; // the resource load during off-peak hr + double holidayLoad = 0.0; // the resource load during holiday + + // incorporates weekends so the grid resource is on 7 days a week + LinkedList Weekends = new LinkedList(); + Weekends.add(new Integer(Calendar.SATURDAY)); + Weekends.add(new Integer(Calendar.SUNDAY)); + + // incorporates holidays. However, no holidays are set in this example + LinkedList Holidays = new LinkedList(); + DataGridResource gridRes = null; + try { + // create the replica manager + SimpleReplicaManager rm = new SimpleReplicaManager("RM_" + name, + name); + + // create the resource calendar + ResourceCalendar cal = new ResourceCalendar(time_zone, peakLoad, + offPeakLoad, holidayLoad, Weekends, Holidays, seed); + + // create a storage + Storage storage = new HarddriveStorage("storage", 100000); // 100GB + + // create the DataGrid resource + gridRes = new DataGridResource(name, new SimpleLink(name + "_link", + baud_rate, delay, MTU), resConfig, cal, rm); + + // add a storage to the resource + gridRes.addStorage(storage); + + // tell the resource about a replica catalogue + gridRes.setReplicaCatalogue(TopRegionalRC.DEFAULT_NAME); + + } catch (Exception e) { + e.printStackTrace(); + } + + System.out.println("Finally, creates one Grid resource (name: " + name + + " - id: " + gridRes.get_id() + ")"); + System.out.println(); + + return gridRes; + } +} Added: branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletUser.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletUser.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletUser.java 2008-07-22 09:44:36 UTC (rev 188) @@ -0,0 +1,160 @@ +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + */ + +package gridsim.fnbExample; + +import eduni.simjava.Sim_event; +import eduni.simjava.Sim_type_p; +import gridsim.GridSim; +import gridsim.GridSimTags; +import gridsim.GridletList; +import gridsim.ParameterException; +import gridsim.datagrid.DataGridTags; +import gridsim.datagrid.DataGridUser; +import gridsim.datagrid.DataGridlet; +import gridsim.datagrid.File; +import gridsim.net.SimpleLink; +import eduni.simjava.Sim_system; +import gridsim.net.fnb.Fnb_failed_gridlet_file; + +/** + * This class implements a user which creates a set of data gridlets, i.e. a set + * of jobs that require a certain amount of computational power and some data in + * order to execute. The required data is described as a set of files that have + * to be available on the site when the gridlet starts to execute. When the + * gridlets are created, the user submits them to a set of resources and waits + * until all the gridlets have finished executing. + * + * @author Uros Cibej and Anthony Sulistio + */ +public class FnbDataGridletUser extends DataGridUser { + + + GridletList outList; // the list of outgoing gridlets + GridletList receiveList; //the list of executed gridlets + + int TOTAL_GL; + + // Constructor + FnbDataGridletUser(String name, double baud_rate, double delay, int MTU, int total_gl) + throws Exception { + + super(name, new SimpleLink(name + "_link", baud_rate, delay, MTU)); + this.receiveList = new GridletList(); + this.outList = new GridletList(); + + TOTAL_GL = total_gl; + + System.out.println("Creating a Gridlet user entity with name = " + name + + ", and id = " + super.getEntityId(name)); + } + + public void body() { + + experiment(); // execute a set of gridlets + + //////////////////////////////////////////////////////// + // shut down I/O ports + shutdownUserEntity(); + terminateIOEntities(); + System.out.println(this.get_name() + ":%%%% Exiting body() at time " + + GridSim.clock()); + } + + private void experiment() { + //wait for all the entities to register + super.gridSimHold(50.0); + + File f1 = null; + File f2 = null; + + //1. create new files + try { + f1 = new File("file1", 5); + f2 = new File("file2", 1); + } catch (ParameterException e) { + System.out.println("Error creating files"); + } + + //2. add files to a resource + //System.out.println("********* addMaster : file1 and file2 "); + if ((addMaster(f1, GridSim.getEntityId("Res_0")) == false) || + (addMaster(f2, GridSim.getEntityId("Res_1")) == false)) + { + System.out.println(" ************************ \n " + super.get_name() + + ": addMaster failed. Shutting down simulation\n ************************ "); + + } + else + { + //3. create TOTAL_GL data gridlets + for (int i = 0; i < TOTAL_GL; i++) + { + // set the ID of this gridlet, the gridlet length in MI, the size of + // the file before and after execution and whether we would like to + // log the history of this object + DataGridlet g = new DataGridlet(i, 1000, 10, 10, false); + + //the gridlet requires two files in order to execute + + //System.out.println("********* addRequiredFile "); + g.addRequiredFile(f1.getName()); + g.addRequiredFile(f2.getName()); + + // the gridlet needs the user id, so that the resource will be able + // to send it back when finished + g.setUserID(this.get_id()); + this.outList.add(g); + } + + //4. submit the data gridlets + for (int i = 0; i < TOTAL_GL; i++) + { + DataGridlet g = (DataGridlet) outList.get(i); + System.out.println(super.get_name() + ": Submitting gridlet " + i + + " to resource " + i); + + super.send(GridSim.getEntityId("Res_" + i), 0, + DataGridTags.DATAGRIDLET_SUBMIT, g); + } + + //5. wait for the gridlets to finish the execution + int counter = 0; + int glID ; + while ((Sim_system.running()) && (counter <TOTAL_GL)) + { + Sim_event ev = new Sim_event(); + super.sim_get_next(ev); // get the next event in the queue + + switch (ev.get_tag()) + { + // if everything works fine + case GridSimTags.GRIDLET_RETURN: + DataGridlet dg = (DataGridlet) ev.get_data(); + this.receiveList.add(dg); + counter = counter +1; + System.out.println(super.get_name() + ": Received back gridlet " + + dg.getGridletID()); + break; + + + // if the gl suffers a dropped pkt + case GridSimTags.FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED: + Fnb_failed_gridlet_file fglf = (Fnb_failed_gridlet_file)ev.get_data(); + glID = fglf.getEntityID(); + counter = counter +1; + System.out.println(super.get_name() + ": FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED. Gridlet " + glID); + break; + + }//switch (ev.get_tag()) + + }// while ((Sim_system.running()) && (counter <TOTAL_GL)) + + }// else + } + +} // end class Added: branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletUser_2.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletUser_2.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbDataGridletUser_2.java 2008-07-22 09:44:36 UTC (rev 188) @@ -0,0 +1,138 @@ +package gridsim.fnbExample; + +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + */ + +import gridsim.GridSim; +import gridsim.IO_data; +import gridsim.ParameterException; +import gridsim.datagrid.DataGridUser; +import gridsim.datagrid.File; +import gridsim.net.SimpleLink; + +import java.util.ArrayList; + +/** + * This is an implementation of a user which performs a set of file managing + * operations on the Data Grid. + * + * @author Uros Cibej and Anthony Sulistio + */ +class FnbDataGridletUser_2 extends DataGridUser { + + private String name_; // user name + + // Constructor + FnbDataGridletUser_2(String name, double baud_rate, double delay, int MTU) + throws Exception { + + super(name, new SimpleLink(name + "_link", baud_rate, delay, MTU)); + this.name_ = name; + + // Gets an ID for this entity + int userID = super.getEntityId(name); + System.out.println("Creating a grid user entity with name = " + name + + ", and id = " + userID); + } + + /** + * The core method that handles communications among GridSim entities. + */ + public void body() { + + experiment(); // execute a set of demands + + // shut down I/O ports + shutdownUserEntity(); + terminateIOEntities(); + System.out.println(this.name_ + ":%%%% Exiting body() at time " + + GridSim.clock()); + } + + private void experiment() { + + // wait for all entities to register + super.gridSimHold(50.0); + int location = 0; + boolean ok = true; + + // create three new files and add them as master files to resource Res_2 + try { + ArrayList fList = new ArrayList(); + int i = 0; + + do{ + + File fNew = new File("file_" + i, 10); + + if (addMaster(fNew, GridSim.getEntityId("Res_2")) == false) + { + System.out.println(" ************************ \n " + + super.get_name() + + ": addMaster failed. Shutting down simulation\n ************************ "); + + ok = false; + + } + + i++; + + + }while ((i < 3) && (ok)); + + } catch (ParameterException e) { + e.printStackTrace(); + } + + if (ok) + { + // get the full name of file1, i.e. file1+ID, where ID is a unique + // number assigned to the file by the top replica catalogue. + String name = getFullFilename("file_0"); + File f = null; + int fileLocation; + if (name != null) + { + // get the location of the file + location = this.getReplicaLocation(name); + if (location != -1) + { + // transfer the file + f = this.getFile(name, location); + System.out.println("user:" + this.get_name() + + ":-Transfer of file " + name + " succesful"); + } + } + + // replicate this file to Res_0 + replicateFile(f, GridSim.getEntityId("Res_0")); + + // replicate this file to Res_1 + replicateFile(f, GridSim.getEntityId("Res_1")); + + // delete replica of file from Res_0 + deleteFile(f.getName(), GridSim.getEntityId("Res_0")); + + // trying to delete a master file will not succeed + // for deleting the master file one should use deleteMaster() + deleteFile(f.getName(), GridSim.getEntityId("Res_2")); + + // but a master file cannot be deleted while there are replicas of the + // file on the Data Grid, so the following will also produce an error + deleteMaster(f.getName(), GridSim.getEntityId("Res_2")); + + // so we first have to delete the replica of file from Res_1 + deleteFile(f.getName(), GridSim.getEntityId("Res_1")); + + // and then we can delete the master file + deleteMaster(f.getName(), GridSim.getEntityId("Res_2")); + + }//if (ok) + } + +} // end class + Added: branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbUser.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbUser.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/fnbExample/FnbUser.java 2008-07-22 09:44:36 UTC (rev 188) @@ -0,0 +1,920 @@ +package gridsim.fnbExample; + +/* + * Title: FnbUser + * Description: An example of how to use the new functionality on finite buffers + * Date: May 2007 + */ + +import gridsim.fnbExample.*; +import gridsim.*; +import gridsim.net.Link; +import java.util.Random; +import java.util.ArrayList; +import java.io.FileWriter; +import eduni.simjava.Sim_system; +import eduni.simjava.Sim_event; +import gridsim.net.fnb.Fnb_failed_gridlet_file; + +/** + * An example of how to use the new functionality on finite buffers + * @author Agustin Caminero, Universidad de Castilla La Mancha (UCLM), Spain. May 2007 + */ +public class FnbUser extends GridUser { + + + public static final int BASE = 44; // the base for our constants (chosen at random) + + /**This constant is to tell the user when he should submit a gridlet*/ + public static final int SUBMIT_GRIDLET = BASE + 1; + + private ArrayList GridletSubmittedList_; // list of submitted Gridlets (array of GridletSubmission) + // private GridletList GridletReceiveList_; // list of received Gridlets + + int receivedGridletCounter; // counts how many gridlets have already comeback after being successfully executed + int ToS_; + int NUM_GRIDLETS; + int myID_; // for a user whose name is "User_0", its myID_ will be 0 + + + // The sizes of gridlets + long gridletLength; + long gridletInput; + long gridletOutput; + + double gridletSubmissionTime []; + // we keep here the time when each gridlet is submitted + + double gridletLatencyTime []; + + int droppedGridletsCounter; + // a counter to keep the number of gridlets which are failed because of dropped packets + + boolean droppedGridletsArray[]; + // a list of the failed gridlets (those which failed because of dropped packets) + + double init_time; //the time when this user will start submitting gridlets + + int resID;//the id of the resource to which this user will send his gl + + + + /** + * Creates a GridUserFailure object + * @param name this entity name + * @param link a network link connecting this entity + * @param myID for a user whose name is "User_0", its myID_ will be 0 + * @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 init_time the time when this user will start submitting gridlets + * @param resID the id of the resource to which this user will send his gl + * @throws java.lang.Exception happens if either name or link is empty + * @pre name != null + * @pre link != null + * @post $none + */ + public FnbUser(String name, Link link, int myID, + long glLength, long glIn, long glOut, double init_time, int resID) throws Exception + { + //super(name,link, true); + super(name,link); + + this.GridletSubmittedList_ = new ArrayList(); + //this.GridletReceiveList_ = new GridletList(); + receivedGridletCounter = 0; + ToS_ = 0; + this.myID_ = myID; + + + gridletLength = glLength; + gridletInput = glIn; + gridletOutput = glOut; + + droppedGridletsCounter = 0; + + this.init_time = init_time; + this.resID = resID; + + } + + /** + * Creates a GridUserFailure object + * @param name this entity name + * @param link a network link connecting this entity + * @param regionalGIS a regional GridInformationService (GIS) entity name + * @param myID for a user whose name is "User_0", its myID_ will be 0 + * @param pollTime the time between polls + * @throws java.lang.Exception happens if one of the inputs is empty + * @pre name != null + * @pre link != null + * @pre regionalGIS != null + * @post $none + */ + public FnbUser(String name, Link link, String regionalGIS, int myID) throws + Exception + { + //super(name, link, true, regionalGIS); + super(name, link, regionalGIS); + ToS_ = 0; + this.myID_= myID; + + + } + + /** + * 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]; + + droppedGridletsArray = new boolean[NUM_GRIDLETS]; + for (int i = 0; i < NUM_GRIDLETS; i++) + { + droppedGridletsArray[i] = false; + } + + } + + /** + * Sets the Type of Service (ToS) that this packet receives in the network + * @param ToS Type of Service + */ + public void setNetServiceLevel(int ToS) { + this.ToS_ = ToS; + } + + + /** + * This function retrieves the list of available resources from the RegGIS. + * @return an array containing the ids of the resources + * */ + int [] getResList() + { + Object[] resList; + resList = super.getLocalResourceList(); + + /* + // REMOVE !!!!! + System.out.println("\n*********" + + super.get_name() + + ": Trying to get list of resources from GIS." + + "\n");*/ + + while ((resList == null) || (resList.length == 0)) + { + + resList = super.getLocalResourceList(); + + } + + int resourceID[] = null; + + if ((resList != null) && (resList.length != 0)) // if we have any resource + { + // System.out.println(super.get_name() + ": Got list of resources +++ "); + 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(); + + } + + } + return resourceID; + } + + /** + * Handles incoming requests to this entity. + * @pre $none + * @post $none + */ + public void body() + { + initializeResultsFile(); + + createGridlet(NUM_GRIDLETS); + + //System.out.println(super.get_name() + ": sizeOf(): " + ); + + super.send(super.get_id(), + GridSimTags.SCHEDULE_NOW + init_time, + SUBMIT_GRIDLET); + + // init_time has been initialized at the constructor + + /* // Uncomment this if you want more info on the progress of the sims + 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: + /* // Uncomment this if you want more info on the progress of the sims + System.out.println(super.get_name() + + ": received an SUBMIT_GRIDLET event. Clock: " + + GridSim.clock());*/ + processGridletSubmission(ev); // process the received event + + ev = null; // new, to call the garbage collector + break; + + // Receive a gridlet back + case GridSimTags.GRIDLET_RETURN: + /* // Uncomment this if you want more info on the progress of the sims + System.out.println(super.get_name() + + ": received an GRIDLET_RETURN event. Clock: " + + GridSim.clock());*/ + processGridletReturn(ev); + + ev = null; // new, to call the garbage collector + break; + + case GridSimTags.END_OF_SIMULATION: + System.out.println("\n============== " + super.get_name() + + ". Ending simulation..."); + break; + + // A gridlet has failed because a packet was dropped + case GridSimTags.FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED: + processGridletPacketDropping(ev); + + ev = null; // new, to call the garbage collector + break; + + default: + System.out.println(super.get_name() + + ": Received an event: " + ev.get_tag()); + + ev = null; // new, to call the garbage collector + break; + + } // switch (ev.get_tag()) + + }// while (Sim_system.running()) + + // remove I/O entities created during construction of this entity + super.terminateIOEntities(); + + //printGridletList(GridletReceiveList_, super.get_name(), false, gridletLatencyTime); + + }// body() + + /** + * This functions process the fail of a gridlet. The failure has happened + * because a packet was dropped. + * @param ev an incoming event + * */ + public void processGridletPacketDropping(Sim_event ev) + { + + Fnb_failed_gridlet_file fglf = (Fnb_failed_gridlet_file)ev.get_data(); + int glID = fglf.getEntityID(); + double clock = GridSim.clock(); + + if (droppedGridletsArray[glID] == false) + { + System.out.println("<<<<<<<<<<<<< " + super.get_name() + + ": Receiving GRIDLET_FAILED_BECAUSE_PACKET_DROPPED at time = " + + GridSim.clock() + ". Gridlet # " + glID); + + fw_write(super.get_name() + "\t" + glID + "\tGRIDLET_DROPPED\t" + clock + + "\n", super.get_name() + "_DroppedGridlets"); + + droppedGridletsArray[glID] = true; + + droppedGridletsCounter = droppedGridletsCounter + 1; + + removeGridletFromGridletSubmittedList(glID); + + if (receivedGridletCounter + droppedGridletsCounter == + NUM_GRIDLETS) + { + // In this case, the user has finished his work, as all the gridlets are back or failed. + // So, finish the simulation. + super.finishSimulation(); + } + + }//if (droppedGridletsArray[glID] == false) + + ev = null; // new, to call the garbage collector + } + + /** This function remove a gridlet from the GridletSubmittedList. + * @param glID the id of the gridlet to be removed */ + void removeGridletFromGridletSubmittedList(int glID) + { + int i = 0; + boolean found = false; + while ((i < GridletSubmittedList_.size()) && (!found)) + { + if (glID == + (((GridletSubmission) GridletSubmittedList_.get(i)).getGridlet()). + getGridletID()) + { + GridletSubmittedList_.remove(i); + found = true; + } + + i++; + } + } + /** + * 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 + * */ + public void processGridletSubmission(Sim_event ev) + { + + /* 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 becasue 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 ) + { + ((GridletSubmission) GridletSubmittedList_.get(i)).setSubmitted(false); + // set this gridlet whose id comes with the event as not submitted, + // so that it is submitted as soon as possible. + + } + + // 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 the regGIS + // This list will never be empty + + + //index = random.nextInt(resourceID.length); + + System.out.println(">>>>>>>>>>>" + super.get_name() + + ". Sending Gridlet #" + i + + " to " + + GridSim.getEntityName(resID) + " at clock: " + + GridSim.clock()); + + + gridletSubmissionTime[gl.getGridletID()] = GridSim.clock(); + + super.gridletSubmit(gl, resID, 0, false, ToS_); + + ((GridletSubmission) GridletSubmittedList_.get(i)). + setSubmitted(true); // set the gridlet as submitted + + // Write into a results file + write(super.get_name(), "Sending", gl.getGridletID(), + GridSim.getEntityName(resID), gl.getGridletStatusString(), + GridSim.clock()); + + } // 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 + * */ + public void processGridletReturn(Sim_event ev) + { + 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 + write(super.get_name(), "Receiving", gl.getGridletID(), + GridSim.getEntityName(gl.getResourceID()), + gl.getGridletStatusString(), + GridSim.clock()); + + //////////////////////////////////////////////////// Gridlet Success + if (gl.getGridletStatusString().compareTo("Success") == 0) + { + // Gridlet successed! + 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 + + receivedGridletCounter = receivedGridletCounter +1; + + gridletLatencyTime[gl.getGridletID()] = gridletLatencyTime[ + gl.getGridletID()] - + gridletSubmissionTime[gl.getGridletID()]; + + + // remove the gridlet, to safe memory + removeGridletFromGridletSubmittedList(gl.getGridletID()); + gl = null; + + // We have received all the gridlets. So, finish the simulation. + if ((receivedGridletCounter == NUM_GRIDLETS) || + (receivedGridletCounter + droppedGridletsCounter == NUM_GRIDLETS)) + { + 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 + { + + ((GridletSubmission) GridletSubmittedList_.get( + pos)).setSubmitted(true); + // 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 + + // Now, schedule an event to this entity 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") + 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 static 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 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); + + 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 */ + public 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 returns true if the gridlet is in the GridletReceiveList_. + * This is, the gridlet has already been successfully executed, and + * received back at the user. Returns false otherwise + * @param glID the id of the gridlet + * */ + /*public boolean IsInGridletReceiveList(int glID) + { + for (int i = 0; i<GridletReceiveList_.size(); i++) + { + if (((Gridlet)GridletReceiveList_.get(i)).getGridletID() == glID) + return true; + } + + return false; + + }*/ + + /** This function resets the gridlet into its original values of length and gridletFinishedSoFar + * @param gl the gridlet to be resetted */ + public void resetGridlet (Gridlet gl) + { + gl.setGridletLength(gridletLength); + gl.setGridletFinishedSoFar(0); + + } + + /** + * This method will show you how to create Gridlets + * @param userID the id of the user to whom this gl belongs + * @param numGridlet number of Gridlet to be created + * @param MILength length of the gridlet in MI + * @param size size of the input/output files + */ + private void createGridlet(int numGridlet) + { + // This function has been copied from the source code sent by Anthony (MainUser.java) + + long data; + int MI = 0; + double percent = 0.30; // 30 % + Random r = new Random(); + + // running approx. 20 mins on CERN node of 70k MIPS +/- 30% + double min_size = gridletLength - (gridletLength * percent); + double max_size = gridletLength + (gridletLength * percent); + int range = 1 + (int) (max_size - min_size); // round up + + + // for network + double data_min = gridletInput - (gridletInput * percent); + double data_max = gridletInput + (gridletInput * percent); + int data_range = 1 + (int) (data_max - data_min); // round up + + + for (int i = 0; i < numGridlet; i++) + { + MI = (int) min_size + r.nextInt(range); + data = (long) data_min + r.nextInt(data_range); + + // Creates a Gridlet + Gridlet gl = new Gridlet(i, MI, data, data); + gl.setUserID(super.get_id()); + gl.setNetServiceLevel(ToS_); + + GridletSubmission gst = new GridletSubmission(gl, false); + + // add this gridlet into a list + this.GridletSubmittedList_.add(gst); + + } + + } + + /** + * 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 + * */ + public static void writeFin(String user, int glID, String resName, double cost, double cpu, double clock) + { + // 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 + * */ + public void write(String user, String event, int glID, String resName, String status, double clock) + { + // 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 + "\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()); + } + + } + + + /** + * Initialize the results files (put headers over each column) + * */ + public void initializeResultsFile() + { + // Initialize the results file + FileWriter fwriter = null; + FileWriter fwriterFin = null; + FileWriter fwriterDropped = null; + try + { + fwriter = new FileWriter(super.get_name(), true); + fwriterFin = new FileWriter(super.get_name() + "_Fin", true); + fwriterDropped = new FileWriter(super.get_name() + "_DroppedGridlets", 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"); + + fwriterDropped.write( "User \t\t GridletID \t Status \t Time\n"); + + + + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while writing on file " + super.get_name() + + " or " + super.get_name() + "_Fin" + " or " + super.get_name() + "_DroppedGridlets"); + } + + try + { + fwriter.close(); + fwriterFin.close(); + fwriterDropped.close(); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println( + "Unwanted errors while closing file " + super.get_name() + " or " + + super.get_name() + "_Fin" + " or " + super.get_name() + + "_DroppedGridlets"); + } + } + /** + * Prints out the given message into stdout. + * In addition, writes it into a file. + * @param msg a message + * @param file file where we want to write + */ + private static void fw_write(String msg, String file) + { + //System.out.print(msg); + FileWriter fwriter = null; + + try + { + fwriter = new FileWriter(file, true); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println("Unwanted errors while opening file " + file); + } + + try + { + fwriter.write(msg); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println("Unwanted errors while writing on file " + file); + } + + try + { + fwriter.close(); + } catch (Exception ex) + { + ex.printStackTrace(); + System.out.println("Unwanted errors while closing file " + file); + } + } + + +} Added: branches/gridsim4.0-branch2/source/gridsim/fnbExample/GridletSubmission.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/fnbExample/GridletSubmission.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/fnbExample/GridletSubmission.java 2008-07-22 09:44:36 UTC (rev 188) @@ -0,0 +1,64 @@ +/* + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * $Id:$ + */ + + +/* + * Agustin Caminero + * Instituto de Investigacion en Informatica de Albacete + * Universidad de Castilla La Mancha, Spain + * January, 2007. + * + * This class implements the submission time of each gridlet. + * + */ + + +package gridsim.fnbExample; + +import gridsim.Gridlet; + +/** + * @author Agustin Caminero, Universidad de Castilla La Mancha (UCLM), Spain. Nov 2006. + * This class implements the submission time of each gridlet. + * @since GridSim 4.1 + */ +public class GridletSubmission +{ + private Gridlet gl; + private boolean submitted; // whether this gridlet has been already submitted or not + + 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; + } + + + +} Property changes on: branches/gridsim4.0-branch2/source/gridsim/fnbExample/GridletSubmission.java ___________________________________________________________________ Added: svn:executable + * Added: branches/gridsim4.0-branch2/source/gridsim/fnbExample/mainExample.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/fnbExample/mainExample.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/fnbExample/mainExample.java 2008-07-22 09:44:36 UTC (rev 188) @@ -0,0 +1,1194 @@ +package gridsim.fnbExample; + + +/* + * Author: Agustin Caminero, Universidad de Castilla La Mancha, (Spain). + * Date: May 2007 + */ + + +import gridsim.net.fnb.*; +import gridsim.*; +import gridsim.net.*; +import java.util.*; +import gridsim.index.RegionalGIS; +import gridsim.fnbExample.*; +import gridsim.util.TrafficGenerator; +import eduni.simjava.distributions.Sim_uniform_obj; +import gridsim.util.Poisson; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.FileWriter; + + +/** + * @author Agustin Caminero, Universidad de Castilla La Mancha (UCLM), Spain. May 2007. + */ +public class mainExample +{ + /** + * Creates main() to run this example + */ + public static void main(String[] args) + { + System.out.println("Starting finite buffers example ..."); + + try + { + if (args.length < 1) + { + System.out.println( + "Usage: java mainExample config_file"); + return; + } + + /////////// args[0] + String CONFIG_FILE = args[0]; + + + /////////////////////////////////// + String storeStats_str = searchForValueString("STORE_STATS", + CONFIG_FILE); + + boolean STORE_STATS; + + if (storeStats_str.compareTo("TRUE") == 0) + STORE_STATS = true; + else + STORE_STATS = false; + + /////////////////////////////////// + int TOT... [truncated message content] |
From: <aca...@us...> - 2008-07-22 09:39:42
|
Revision: 187 http://gridsim.svn.sourceforge.net/gridsim/?rev=187&view=rev Author: acaminero Date: 2008-07-22 09:39:48 +0000 (Tue, 22 Jul 2008) Log Message: ----------- Finite buffers extension Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbDroppedPacketInfo.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/firstLastPacketsGridlet.java Added Paths: ----------- branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_failed_gridlet_file.java Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbDroppedPacketInfo.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbDroppedPacketInfo.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbDroppedPacketInfo.java 2008-07-22 09:39:48 UTC (rev 187) @@ -23,8 +23,10 @@ private int userID; + // private String fileName; + /**Creates a new object of this class. This is used by FnbSCFQScheduler * @param g the gridlet id * @param u user id @@ -35,7 +37,21 @@ userID = u; } + /** Sets the filename. + * */ + /*public void setFilename(String f) + { + fileName = f; + }*/ + /** Gets the filename. + * @return the gridlet id. + * */ + /*public String getFilename() + { + return fileName; + }*/ + /** Gets the gridlet id. * @return the gridlet id. * */ Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java 2008-07-22 09:39:48 UTC (rev 187) @@ -1,34 +1,43 @@ /* - * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation - * of Parallel and Distributed Systems such as Clusters and Grids - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html - * + * Title: GridSim Toolkit + * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * of Parallel and Distributed Systems such as Clusters and Grids + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * $Id: FnbNetPacket.java,v 1.13 2008/05/09 05:56:31 agustin Exp $ - */ + */ package gridsim.net.fnb; - /** - * This class keeps some information which are common to all the packets of a gridlet. - * When a packet is dropped in a router, the router must inform the user/owner - * about this scenario. - * Since many packets from the same gridlet may get dropped, the router only sends - * one event for the whole process, not for each dropped packet. - * Thus, we put all of the common information (e.g. source and destination IDs) - * into this class. - * - * @since GridSim Toolkit 4.1 - * @author Agustin Caminero +/** + * This class keeps some information which are common to all the packets of a gridlet. + * When a packet is dropped in a router, the router must inform the user/owner + * about this scenario. + * Since many packets from the same gridlet may get dropped, the router only sends + * one event for the whole process, not for each dropped packet. + * Thus, we put all of the common information (e.g. source and destination IDs) + * into this class. + * + * @since GridSim Toolkit 4.1 + * @author Agustin Caminero */ public class FnbEndToEndPath { private int destID; private int srcID; private int classtype; - private int totalPkts; // total num of packet that belongs to a group - private int glID; // the id of the gridlet/file this packet belongs to, + private int totalPkts; // total num of packet that belongs to a group + private int glID; + // the id of the gridlet/file this packet belongs to, or GridSimTags.FNB_PKT_CONTAINS_FILE + // if the pkt contains a file + /*private String fileName; // the name of the file contained in this pkt. + //We have to use the file name since files may not have a id, if they've not been registered yet.*/ + + //private int fileMyID;// This is a temporary id for the file. This is necesary as files dont have + // id unteil they are registered. + + /**Creates a new object of this class. Tihs is used in the FnbOutput class. * @param destID destination id * @param sourceID source id @@ -36,32 +45,70 @@ * @param totalPkts total number of packets this connection is made of * @param glID the gridlet/file id * */ - public FnbEndToEndPath (int destID, int srcID, int classtype, int totalPkts, int glID) + public FnbEndToEndPath(int destID, int srcID, int classtype, int totalPkts, + int glID) { this.destID = destID; this.srcID = srcID; this.classtype = classtype; this.totalPkts = totalPkts; this.glID = glID; + //this.fileName = null; + //this.fileMyID = -1; } /**Creates a new object of this class. Tihs is used in the FnbOutput class. - * @param destID destination id - * @param sourceID source id - * @param classType network service level - * @param totalPkts total number of packets this connection is made of - * @param glID the gridlet id - * */ - public FnbEndToEndPath (int destID, int srcID, int classtype, int totalPkts) - { - this.destID = destID; - this.srcID = srcID; - this.classtype = classtype; - this.totalPkts = totalPkts; - this.glID = -1; - } + * @param destID destination id + * @param sourceID source id + * @param classType network service level + * @param totalPkts total number of packets this connection is made of + * @param glID the gridlet id + * */ + public FnbEndToEndPath(int destID, int srcID, int classtype, int totalPkts) + { + this.destID = destID; + this.srcID = srcID; + this.classtype = classtype; + this.totalPkts = totalPkts; + this.glID = -1; + //this.fileName = null; + //this.fileMyID = -1; + } + /** Sets the fileName for a connection, in the case it carries a file. + * @param d the destination id + * */ + /*public void setFileName(String f) + { + fileName = f; + }*/ + + /** Returns the fileName for a connection, in the case it carries a file. + * @param d the destination id + * */ + /*public String getFileName() + { + return fileName; + }*/ + + /** Sets the file my_id. + * @param d the destination id + * */ + /*public void setFileMyID(int d) + { + fileMyID = d; + }*/ + + /** Returns the file my_id. + * @param d the destination id + * */ + /*public int getFileMyID() + { + return fileMyID; + }*/ + + /** Sets the destination id for a connection. * @param d the destination id * */ @@ -94,7 +141,7 @@ * */ public void setTotalPkts(int t) { - totalPkts = t; + totalPkts = t; } /** Gets the source id of a connection. @@ -115,7 +162,6 @@ } - /** Gets the classtype of a connection. * @return the classtype of the connection * */ @@ -125,7 +171,6 @@ } - /** Gets the total number of packets of a connection. * @return the total number of packets of the connection * */ Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java 2008-07-22 09:39:48 UTC (rev 187) @@ -334,5 +334,6 @@ return conn.getObjectID(); } + } // end class Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java 2008-07-22 09:39:48 UTC (rev 187) @@ -53,6 +53,8 @@ private ArrayList packetsGridletsList_; // list of firstLastPacketsGridlet objects // This list contains the first/last packets belonging to each gridlet + private ArrayList filesname_fileMyIDs_; // keep a list of Fnb_FileName_FileMyID objects + /** * Allocates a new Output object * @param name the name of this object @@ -83,6 +85,8 @@ hasStarted_ = false; packetsGridletsList_ = new ArrayList(); + filesname_fileMyIDs_ = new ArrayList(); + System.out.println(super.get_name()); } @@ -315,20 +319,20 @@ * */ public void processPacketDropped(Sim_event ev) { - FnbDroppedUserPacket userPkt = (FnbDroppedUserPacket) ev.get_data(); int pkt_dropped_id = userPkt.getPkt(); int user_id = userPkt.getUser(); - int glID = lookForGridlet(pkt_dropped_id); + Fnb_failed_gridlet_file fglf = lookForGridlet(pkt_dropped_id); + int glID = fglf.getEntityID(); - if (glID != 99) + if (glID != 9999) { // Tell the user that the gridlet is failed because of the dropping of a packet super.sim_schedule(user_id, GridSimTags.SCHEDULE_NOW, - GridSimTags.FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED, - new Integer(glID)); + GridSimTags.FNB_GRIDLET_FAILED_BECAUSE_PACKET_DROPPED, fglf); } + ev = null; // new, to call the garbage collector @@ -532,6 +536,7 @@ */ private synchronized void submitToLink(Sim_event ev) { + //Object[] packet = new Object[2]; IO_data data = (IO_data) ev.get_data(); Object obj = data.getData(); long size = data.getByteSize(); @@ -547,32 +552,100 @@ int glID = 9999; int fileID = 9999; firstLastPacketsGridlet packGl = new firstLastPacketsGridlet(); - FnbEndToEndPath conn; - if (obj instanceof Gridlet) - { - glID = ((Gridlet) obj).getGridletID(); - // Here we will keep the packets belonging to each gridlet + FnbEndToEndPath conn = null; + try{ - packGl.setFirst(pktID_); // the first packet of this gridlet - packGl.setGridletID(glID); + if (obj instanceof Gridlet) + { + glID = ((Gridlet) obj).getGridletID(); + // Here we will keep the packets belonging to each gridlet - conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets, glID); + packGl.setFirst(pktID_); // the first packet of this gridlet + packGl.setGridletID(glID); - } - /******* TODO: not yet done - else if (obj instanceof File) // For the datagrid extension + conn = new FnbEndToEndPath(destId, super.get_id(), + netServiceType, numPackets, glID); + + } + else if (obj instanceof DataGridlet) // For the datagrid extension + { + glID = ((DataGridlet) obj).getGridletID(); + + // Here we will keep the packets belonging to each gridlet + + packGl.setFirst(pktID_); // the first packet of this gridlet + packGl.setGridletID(glID); + + conn = new FnbEndToEndPath(destId, super.get_id(), + netServiceType, numPackets, glID); + + } + else if (obj instanceof Object[]) // For the datagrid extension (File) + { + + + String fileName = null; + + try + { + // Add master (from user to resource) + + fileName = ((File) ((Object[]) obj)[0]).getName(); + + }catch(Exception e) + { + + fileName = ((String) ((Object[]) obj)[0]); + + } + + + /* + int length = ((Object[])obj).length; + if (length == 2) + { + // Add master (from user to resource) + + fileName = ((File) ((Object[]) obj)[0]).getName(); + + }// if (length == 2) + else if (length == 3) + { + // Add master (from res to user) + fileName = ((String) ((Object[]) obj)[0]); + + }*/ + + glID = checkFilename(fileName); // get a id for the file + + packGl.setFirst(pktID_); // the first packet of this file + packGl.setGridletID(glID); // the name of the file + + packGl.setIsFile(true); + + + conn = new FnbEndToEndPath(destId, super.get_id(), + netServiceType, numPackets, glID); + //GridSimTags.FNB_PKT_CONTAINS_FILE); + + //System.out.println(super.get_name() + ": fileName: " + fileName); + + + + } + else + { + conn = new FnbEndToEndPath(destId, super.get_id(), + netServiceType, numPackets); + } + + }catch(Exception e) { - fileID = ((File) obj).getRegistrationID(); - System.out.println("FileID: " + fileID); - conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets, fileID); - } - ******/ - else - { - conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets); - } + System.out.println(super.get_name() + ":ERROR."); + e.printStackTrace(); + } // make dummy packets with null data convertIntoPacket(MTU, numPackets, tag, conn); @@ -590,14 +663,15 @@ super.get_id(), destId, netServiceType, numPackets, numPackets);*/ - if (obj instanceof Gridlet) + if ((obj instanceof Gridlet) || (obj instanceof DataGridlet) || + (obj instanceof Object[])) { packGl.setLast(pktID_); // the last packet of this gridlet packetsGridletsList_.add(packGl); // put this firstLastPacketsGridlet entity into the list /*System.out.println(">>>>>>>>>> "+super.get_name() + - ": submitting gl: " + glID + " .(First, last): (" + + ": submitting entity: " + glID + " .(First, last): (" + packGl.getFirst() + ", " + packGl.getLast() + ")");*/ } @@ -607,6 +681,59 @@ pktID_++; // increments packet ID } + /**Returns the my_id of the file. */ + int checkFilename(String fname) + { + Fnb_FileName_FileMyID fname_fid; + int last_fileID = 0; + for (int i =0; i< filesname_fileMyIDs_.size(); i++) + { + fname_fid = (Fnb_FileName_FileMyID) filesname_fileMyIDs_.get(i); + + last_fileID = fname_fid.getFileId(); + + if (fname_fid.getFileName().compareTo(fname) == 0) + { + return last_fileID; + } + } + + fname_fid = new Fnb_FileName_FileMyID(fname, last_fileID + 1); + + filesname_fileMyIDs_.add(fname_fid); + + + return last_fileID + 1; + } + + /**Returns the file name of the file with the given my_id*/ + String getFilename(int fileID) + { + Fnb_FileName_FileMyID fname_fid; + int last_fileID = 0; + + /*System.out.println(super.get_name() + ": getFilename(). fileID " + fileID + + ". filesname_fileMyIDs_.size() : " + + filesname_fileMyIDs_.size());*/ + + for (int i = 0; i < filesname_fileMyIDs_.size(); i++) + { + fname_fid = (Fnb_FileName_FileMyID) filesname_fileMyIDs_.get(i); + + last_fileID = fname_fid.getFileId(); + + //System.out.println(super.get_name() + ": last_fileID: " + last_fileID + ". filename: " + fname_fid.getFileName()); + + if (last_fileID == fileID) + { + return fname_fid.getFileName(); + } + } + + return null; + + } + /** * Creates many dummy or null packets * @param size packet size (in bytes) @@ -865,12 +992,13 @@ return packetsGridletsList_; } - /**This function returns the gridlet to which a packet belongs + /**This function returns the entity (gridlet/file) to which a packet belongs * @param pkt the ID of the packet of interest - * @return the gridlet ID + * @return a Fnb_failed_gridlet_file object, containing the entity (gridlet/file) ID, and if the entity is a file * */ - int lookForGridlet(int pktID) + Fnb_failed_gridlet_file lookForGridlet(int pktID) { + Fnb_failed_gridlet_file fglfile = new Fnb_failed_gridlet_file(9999, false); for (int i = 0; i < packetsGridletsList_.size(); i++) { firstLastPacketsGridlet flPktGl = (firstLastPacketsGridlet) @@ -878,11 +1006,21 @@ if ((flPktGl.getFirst() <= pktID) && (flPktGl.getLast() > pktID)) { - return flPktGl.getGridletID(); + fglfile.setEntityID(flPktGl.getGridletID()); + fglfile.setIsFile(flPktGl.getIsFile()); + + fglfile.setFilename(getFilename(fglfile.getEntityID())); + + /*System.out.println(super.get_name() + ": lookForGridlet: entiyID: " + + flPktGl.getGridletID() + ". isFile " + flPktGl.getIsFile() + + ". filename " + getFilename(fglfile.getEntityID()));*/ + + return fglfile; } } - return 99;// if there is no gridlet, return this + return fglfile;// if there is no gridlet, return this } + } // end class Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java 2008-07-22 09:39:48 UTC (rev 187) @@ -82,7 +82,8 @@ private int MAX_BUFF_SIZE_PK; //max number of packets that fit into a buffer private ArrayList droppedGl_user; - // in this array, we keep the list of glID_userID objects, showing the (gridlets, userID) already dropped in this scheduler. + // in this array, we keep the list of FnbDroppedPacketInfo objects, showing the (gridlets, userID) + // already dropped in this scheduler. // This way, we will only send a PACKET_DROPPED event for the first dropped packet of a gridlet. // This way, we will avoid a lot of events, thus saving memory. @@ -675,7 +676,13 @@ String dst_str; int glID; + //String filename; + /*System.out.println("\n" + super.get_name() + + ":(make) Size(): " + + size() + " pkts. Time: " + GridSim.clock());*/ + + for (int i = 0; i < size() ; i++) { pkt = (Packet) pktList.get(i); @@ -718,9 +725,9 @@ (dst_str.indexOf("RC") != -1))*/ - // if the src or the dest of the packet are in the whitelist, then try not to drop the packet - if ((GridSim.fnbWhiteList_.checkList(dst) == true) || - (GridSim.fnbWhiteList_.checkList(src_outputPort) == true)) + // if the src and the dest of the packet are not in the whitelist, then we can drop the pkt + if ((GridSim.fnbWhiteList_.checkList(dst) == false) && + (GridSim.fnbWhiteList_.checkList(src_outputPort) == false)) { // To remove a packet form this queue we have to do some stuff // I've copied this from the deque method @@ -888,6 +895,7 @@ } /**Checks if there is an existing gridletID_userID in the droppedGl_user array. + * We consider gridlets, datagridlets and files * @return true, if there is a gridletID_userID object, false otherwise */ public boolean checkDroppedGlList(int gl, int user) { @@ -895,8 +903,9 @@ FnbDroppedPacketInfo glID_uID; while (i < droppedGl_user.size()) { - glID_uID = (FnbDroppedPacketInfo)droppedGl_user.get(i); + glID_uID = (FnbDroppedPacketInfo) droppedGl_user.get(i); if ((glID_uID.getGlID() == gl) && (glID_uID.getUserID() == user)) + return true; else i++; Added: branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_FileName_FileMyID.java 2008-07-22 09:39:48 UTC (rev 187) @@ -0,0 +1,26 @@ +package gridsim.net.fnb; + +public class Fnb_FileName_FileMyID +{ + // Since files don't have an id until they are registered, we need an id for them. + String filename; + int fileMyID; + + Fnb_FileName_FileMyID(String f, int fid) + { + filename = f; + fileMyID = fid; + + } + + + String getFileName() + { + return filename; + } + + int getFileId() + { + return fileMyID; + } +} Added: branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_failed_gridlet_file.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_failed_gridlet_file.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/Fnb_failed_gridlet_file.java 2008-07-22 09:39:48 UTC (rev 187) @@ -0,0 +1,51 @@ +package gridsim.net.fnb; + +public class Fnb_failed_gridlet_file +{ + int entityID; // the id of the gl or file + + boolean isFile; // true if this is a file, false otherwise + + String filename; + + public Fnb_failed_gridlet_file(int e, boolean f) + { + entityID = e; + isFile = f; + } + + public void setFilename(String f) + { + filename = f; + } + + public String getFilename() + { + return filename; + } + + + + + public void setEntityID(int i) + { + entityID = i; + } + + public void setIsFile(boolean f) + { + isFile = f; + } + + public int getEntityID() + { + return entityID; + } + + + public boolean getIsFile() + { + return isFile; + } + +} Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java 2008-07-22 09:39:48 UTC (rev 187) @@ -99,6 +99,8 @@ MAX_P = max_p; QUEUE_WEIGHT = queue_weigth; + System.out.println(super.get_name() + ": RED. MIN_TH: " +MIN_TH +". MAX_TH: " +MAX_TH ); + initialize(); } @@ -117,6 +119,8 @@ double avgQueueSize = avgQueueSize(); + //System.out.println(super.get_name() + ": enque. MIN_TH: " +MIN_TH ); + if ((MIN_TH <= avgQueueSize) && (avgQueueSize < MAX_TH)) { // when the avgQueueSize is between the thrsholds, then calculate the dropping probability @@ -161,27 +165,8 @@ */ public void setThresholds() { + // This is empty, since thresholds are set by hand in the constructor - // The code below is also useds in setBaudRate(...) - double C = super.getBaudRate() / (Link.DEFAULT_MTU * 8); - // baudRate_is in bits per second, MTU is in bytes. ( (bits / sec) / (bits/pkt) ) - QUEUE_WEIGHT = 1 - Math.exp( -1 / C); - - double DELAY_TARGET = 0.005; // 5 milliseconds - double var = DELAY_TARGET * C / 2; - - if (5 > var) - { - MIN_TH = 5; - } - else - { - MIN_TH = var; - - } - - MAX_TH = 3 * MIN_TH; - } /** @@ -298,11 +283,11 @@ } } - /* - // If u want more info on the progress of sims, uncomment this. - System.out.println(super.get_name() + ": packet dropped. Src: " + + + // If u want more info on the progress of sims, uncomment this. + System.out.println(super.get_name() + ": packet dropped. Src: " + src_outputPort_str + ", Dst: " + dst_str + - ". Pkt num: " + ((FnbNetPacket) pnp).getPacketNum());*/ + ". Pkt num: " + ((FnbNetPacket) pnp).getPacketNum()); // If the packet is not a control packet, we will have to remove the packet, and // also, we will have to tell the user involved in the transmission about the dropping. @@ -343,6 +328,7 @@ int pktID; int tag; int glID; + //String filename= null; //int userID; if (pnp instanceof InfoPacket) { @@ -357,8 +343,7 @@ // check the user and the gl this packet belongs to glID = ((FnbNetPacket) pnp).getObjectID(); - - + //filename = ((FnbNetPacket) pnp).getFileName(); } if (tag != GridSimTags.JUNK_PKT) // && (tag != GridSimTags.EMPTY_PKT)) @@ -394,26 +379,30 @@ FnbDroppedPacketInfo gu = new FnbDroppedPacketInfo(glID, entity); insertGlID_userID(gu); - /*System.out.println("\n" + super.get_name() + + System.out.println("\n" + super.get_name() + ": A packet has been dropped, and an ACK has been sent.\n" + " src.output: " + src_outputPort_str + ". dst_inputPort: " + dst_str + "\n Time: " + - GridSim.clock() + ". PktID: " + pnp.getID() +". Gl: " + glID);*/ + GridSim.clock() + ". PktID: " + pnp.getID() + + ". Gl: " + glID + + ". destination_packetsDroppedEvent: " + + destination_packetsDroppedEvent); } else{ - /* System.out.println("\n" + super.get_name() + + System.out.println("\n" + super.get_name() + ": A packet has been dropped.\n" + " src.output: " + src_outputPort_str + ". dst_inputPort: " + dst_str + "\n Time: " + GridSim.clock() + ". PktID: " + pnp.getID() + ". Gl: " + - glID);*/ - } + glID + ". destination_packetsDroppedEvent: " + + destination_packetsDroppedEvent); + } pnp = null; // remove the packet. } Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/firstLastPacketsGridlet.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/firstLastPacketsGridlet.java 2008-07-14 05:43:43 UTC (rev 186) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/firstLastPacketsGridlet.java 2008-07-22 09:39:48 UTC (rev 187) @@ -25,9 +25,11 @@ { int firstPacket; // the id of the first packet in a gridlet int lastPacket; // the id of the last packet in a gridlet - int gridletID; // the gridlet id + int gridletID; // the gridlet/file id + boolean isFile; + /**Creates a new object of this class. This is used in the FnbInput and FnbOutput classes. * @param first id of the first packet * @param last id of the last packet @@ -38,8 +40,26 @@ firstPacket = first; lastPacket = last; gridletID = gl; + isFile = false; } + + + /** Sets the isFile. + * */ + public void setIsFile(boolean f) + { + isFile = f; + } + + /** Gets the isFile. + * @return true is this is a file + * */ + public boolean getIsFile() + { + return isFile; + } + /** Gets the id of the first packet. * @return the id of the first packet * */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sul...@us...> - 2008-07-14 05:43:35
|
Revision: 186 http://gridsim.svn.sourceforge.net/gridsim/?rev=186&view=rev Author: sulistio Date: 2008-07-13 22:43:43 -0700 (Sun, 13 Jul 2008) Log Message: ----------- create a new branch for the GSSIM project Added Paths: ----------- branches/gssim/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-06-18 14:16:56
|
Revision: 185 http://gridsim.svn.sourceforge.net/gridsim/?rev=185&view=rev Author: marcos_dias Date: 2008-06-18 07:16:44 -0700 (Wed, 18 Jun 2008) Log Message: ----------- This update includes cancellation features in the advance reservation policy that uses conservative backfilling and multiple partitions Modified Paths: -------------- branches/gridsim4.0-branch3/source/gridsim/turbo/ARCBMultiplePartitions.java branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/ARCBMultiplePartitions.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/ARCBMultiplePartitions.java 2008-06-17 07:21:14 UTC (rev 184) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/ARCBMultiplePartitions.java 2008-06-18 14:16:44 UTC (rev 185) @@ -500,15 +500,86 @@ } /** - * Handles a cancel reservation request<br> - * (NOTE: <b>NOT SUPPORTED YET</b>). - * @param message the advance reservation message received. - * @return <tt>false</tt>. + * This method handles a cancel reservation request. + * @param message the advance reservation message received requesting + * the cancellation + * @return <tt>true</tt> if the reservation was cancelled; + * <tt>false</tt> otherwise. + * @pre message != null */ public boolean handleCancelReservation(ARMessage message) { - System.out.println(super.get_name() + - ".handleCancelReservation(): not supported at the moment."); - return false; + double currentTime = GridSim.clock(); + + // gets the reservation id of the message + int reservationId = message.getReservationID(); + boolean success = true; + SSReservation sRes = null; + + // creates a response message to be sent to the requester + ARMessage response = message.createResponse(); + + if(!reservTable_.containsKey(reservationId) + && !expiryTable_.containsKey(reservationId)) { + + System.out.println(super.get_name() + ".handleCancelReservation() " + + "Reservation # " + reservationId + " cannot be cancelled " + + "because the allocation policy could not find it."); + success = false; + } + else if (expiryTable_.containsKey(reservationId)) { + System.out.println(super.get_name() + ".handleCancelReservation()" + + " Reservation # " + reservationId + " cannot be cancelled " + + " because it is already in the expiry list."); + success = false; + } + else if( (sRes = reservTable_.get(reservationId)).getActualFinishTime() <= currentTime ) { + System.out.println(super.get_name() + ".handleCancelReservation()" + + " Reservation # " + reservationId + " cannot be cancelled because " + + " it has already finished."); + success = false; + } + + // if it was not possible to cancel the reservation, then return + // an error message back to the requester + if(!success) { + response.setErrorCode(ARMessage.EC_OPERATION_FAILURE); + sendARMessage(response); + return false; + } + + boolean inProgress = sRes.getStatus() == Reservation.STATUS_IN_PROGRESS; + + // remove the reservation from the reservation table + // and put it into the expiry table + reservTable_.remove(reservationId); + expiryTable_.put(reservationId, sRes); + + // remove/update the entries of the profile + removeReservation(sRes); + + // sets the status of the reservation to cancelled + sRes.setStatus(Reservation.STATUS_CANCELLED); + + //----------------- USED FOR DEBUGGING PURPOSES ONLY ------------------- + + // If a gridlet has been cancelled, then inform the listeners + GridSim.notifyListeners(this.get_id(), AllocationAction.ITEM_CANCELLED, true, sRes); + + //---------------------------------------------------------------------- + + // performs the compression of the schedule + compressSchedule(sRes.getStartTime(), inProgress); + + //----------------- USED FOR DEBUGGING PURPOSES ONLY ------------------- + + // Inform the listeners about the new schedule + GridSim.notifyListeners(this.get_id(), AllocationAction.SCHEDULE_CHANGED, true); + + //---------------------------------------------------------------------- + + // send the response message back to the requester + sendARMessage(response); + return true; } /** Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java 2008-06-17 07:21:14 UTC (rev 184) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java 2008-06-18 14:16:44 UTC (rev 185) @@ -1180,9 +1180,7 @@ System.out.println(super.get_name() + ": Collecting Gridlets ..."); list_ = new ArrayList<Gridlet>(gridletID_ + 1); gridletsReturned_ = 1; // starts at 1, since gridletID_ starts at 1 too - Object data = null; - Gridlet gl = null; Sim_event ev = new Sim_event(); while ( Sim_system.running() ) @@ -1658,7 +1656,6 @@ } return -1; // error, did not converged } - /* * Returns the GCF @@ -1759,7 +1756,7 @@ w = logGamma(q); p = Math.floor(q); if (p == q) - throw new ArithmeticException("lgamma: Overflow"); + throw new ArithmeticException("logGamma: Overflow"); z = q - p; if (z > 0.5) { p += 1.0; @@ -1767,7 +1764,7 @@ } z = q * Math.sin(Math.PI * z); if (z == 0.0) - throw new ArithmeticException("lgamma: Overflow"); + throw new ArithmeticException("logGamma: Overflow"); z = LOGPI - Math.log(z) - w; return z; } @@ -1780,7 +1777,7 @@ } while (x < 2.0) { if (x == 0.0) - throw new ArithmeticException("lgamma: Overflow"); + throw new ArithmeticException("logGamma: Overflow"); z /= x; x += 1.0; } @@ -1794,7 +1791,7 @@ } if (x > 2.556348e305) - throw new ArithmeticException("lgamma: Overflow"); + throw new ArithmeticException("logGamma: Overflow"); q = (x - 0.5) * Math.log(x) - x + 0.91893853320467274178; if (x > 1.0e8) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-06-17 07:21:08
|
Revision: 184 http://gridsim.svn.sourceforge.net/gridsim/?rev=184&view=rev Author: marcos_dias Date: 2008-06-17 00:21:14 -0700 (Tue, 17 Jun 2008) Log Message: ----------- This update contains bug fixes on the advance reservation policies. The cancellation of a reservation was not performed properly. Also, the option to get the scheduling options for a job was returning a list with incorrect slots. Modified Paths: -------------- branches/gridsim4.0-branch3/examples/examples/ar/ARTest.java branches/gridsim4.0-branch3/source/gridsim/turbo/ARParallelSpaceShared.java branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java branches/gridsim4.0-branch3/source/gridsim/turbo/TimeSlot.java Modified: branches/gridsim4.0-branch3/examples/examples/ar/ARTest.java =================================================================== --- branches/gridsim4.0-branch3/examples/examples/ar/ARTest.java 2008-06-13 00:55:20 UTC (rev 183) +++ branches/gridsim4.0-branch3/examples/examples/ar/ARTest.java 2008-06-17 07:21:14 UTC (rev 184) @@ -186,7 +186,7 @@ System.out.println("Availability information returned by the " + "Grid resource # " + resID + " at time # " + GridSim.clock() + - " is as follows: \n " + availability); + " is as follows: \n " + availability); // try immediate reservation, where starting time is 0 meaning // use current time as the start time @@ -209,6 +209,22 @@ if(reservation != null && reservation.getStatus() != Reservation.STATUS_FAILED) { System.out.println(super.get_name() + ": reservation has been accepted by "+ resName + " at time = " + GridSim.clock()); + +// availability = +// super.queryFreeTime(GridSim.clock(), Integer.MAX_VALUE, resID); +// +// System.out.println("Free time slots:\n" + +// availability.getSchedulingOptions(20, 10000, 80, 1)); + +// super.cancelReservation(reservation.getID()); + +// // queries the availability of the Grid resource +// availability = super.queryFreeTime(GridSim.clock(), Integer.MAX_VALUE, resID); +// +// System.out.println("Availability information returned by the " + +// "Grid resource # " + resID + " at time # " + GridSim.clock() + +// " after cancellation is as follows: \n " + availability); + success = true; } else { Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/ARParallelSpaceShared.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/ARParallelSpaceShared.java 2008-06-13 00:55:20 UTC (rev 183) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/ARParallelSpaceShared.java 2008-06-17 07:21:14 UTC (rev 184) @@ -435,9 +435,6 @@ boolean inProgress = sRes.getStatus() == Reservation.STATUS_IN_PROGRESS; - // sets the status of the reservation to cancelled - sRes.setStatus(Reservation.STATUS_CANCELLED); - // remove the reservation from the reservation table // and put it into the expiry table reservTable_.remove(reservationId); @@ -445,6 +442,9 @@ // remove/update the entries of the profile removeReservation(sRes); + + // sets the status of the reservation to cancelled + sRes.setStatus(Reservation.STATUS_CANCELLED); //----------------- USED FOR DEBUGGING PURPOSES ONLY ------------------- Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-06-13 00:55:20 UTC (rev 183) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-06-17 07:21:14 UTC (rev 184) @@ -130,6 +130,122 @@ */ public double getPotentialStartTime(double readyTime, int duration, int reqPE) { + return getPotentialStartTime(readyTime, duration, reqPE, Double.MAX_VALUE); + } + +// /** +// * Scans the entries in the availability info object returns the start +// * time of the first time frame over which a request with the characteristics +// * provided can be scheduled. +// * @param readyTime the method will consider potential start times +// * further in time than the value given by <tt>readyTime</tt>. +// * @param duration the duration of the request +// * @param reqPE the number of PEs required +// * @return the start time or <tt>-1</tt> if not found. +// */ +// public double getPotentialStartTime(double readyTime, +// int duration, int reqPE) { +// +// if(readyTime < startTime_) +// readyTime = startTime_; +// +// if(readyTime > finishTime_) +// return UNKNOWN; +// +// // the anchor index, the entry in the profile where +// // the request would be placed OR the closest entry to the +// // point where the anchor of the request would be placed +// int anchorIndex = -1; +// +// // a pointer to the anchor entry (described above) +// AvailabilityInfoEntry anchorEntry = null; +// +// double potStartTime = -1; // keep the potential start time of the request +// double potFinishTime = -1; // store the gridlet's expected finish time +// int length = super.size(); +// +// anchorEntry = getPrecedingEntry(readyTime); +// int firstAnchorIndex = super.indexOf(anchorEntry); +// if(firstAnchorIndex == -1) +// firstAnchorIndex = 0; +// +// for(int j=firstAnchorIndex; j<length; j++) { +// AvailabilityInfoEntry entry = super.get(j); +// anchorIndex = super.indexOf(entry); +// +// // scan the profile until an entry with enough PEs is found +// if(entry.getNumPE() < reqPE) { +// continue; +// } +// else { +// +// // sets the start time as the time of the entry +// if(entry.getTime() < readyTime) +// potStartTime = readyTime; +// else +// potStartTime = entry.getTime(); +// +// // calculates when the finish time will be if +// // the gridlet is put at this position +// potFinishTime = potStartTime + duration; +// +// // if an entry with enough PEs is found, then scan the list +// // from that point onwards analysing the intersection of +// // the ranges available in the entries until the +// // request expected completion time +// PERangeList intersectList = entry.getAvailRanges().clone(); +// +// // Look for the intersection of available ranges from +// // the anchor until the end of the profile or until +// // the entries are further than the expected completion time +// for(int i=anchorIndex+1; i<length; i++){ +// AvailabilityInfoEntry nextEntry = super.get(i); +// if(nextEntry.getTime() > potFinishTime){ +// break; +// } +// else{ +// // if the finish time is equals to the entry time, so there +// // is no need to check the intersection +// if(nextEntry.getTime() < potFinishTime) { +// intersectList = PERangeList.intersection(intersectList, +// nextEntry.getAvailRanges()); +// +// if(intersectList == null || intersectList.getNumPE() < reqPE) { +// break; +// } +// } +// } +// } +// // If a time slot with enough PEs has been found, then stop the search +// if(intersectList != null && intersectList.getNumPE() >= reqPE) { +// break; +// } +// } +// } +// +// // if the potential finish time is larger than the end time of +// // this list, then the request cannot be scheduled +// if(potFinishTime > finishTime_) { +// potStartTime = UNKNOWN; +// } +// +// return potStartTime; +// } + + /** + * Scans the entries in the availability info object returns the start + * time of the first time frame over which a request with the characteristics + * provided can be scheduled. + * @param readyTime the method will consider potential start times + * further in time than the value given by <tt>readyTime</tt>. + * @param duration the duration of the request + * @param reqPE the number of PEs required + * @param deadline the deadline of the job, the user is not interested in + * the start time if the job cannot be completed by the deadline + * @return the start time or <tt>-1</tt> if not found. + */ + public double getPotentialStartTime(double readyTime, + int duration, int reqPE, double deadline) { if(readyTime < startTime_) readyTime = startTime_; @@ -174,6 +290,11 @@ // the gridlet is put at this position potFinishTime = potStartTime + duration; + // The job would not complete before the deadline, then just + // return the potential start time as unknown + if(potFinishTime > deadline) + return UNKNOWN; + // if an entry with enough PEs is found, then scan the list // from that point onwards analysing the intersection of // the ranges available in the entries until the @@ -210,7 +331,7 @@ // if the potential finish time is larger than the end time of // this list, then the request cannot be scheduled - if(potFinishTime > finishTime_) { + if(potFinishTime > finishTime_ || potFinishTime > deadline) { potStartTime = UNKNOWN; } @@ -222,77 +343,16 @@ * can be scheduled or not. The method verifies whether there are enough * processing elements at the start time to serve the request and * whether enough elements will be available over the request's duration. - * @param startTime the start time of the request. + * @param readyTime the start time of the request. This is the time before + * which, the request will not be ready for scheduling. The user is not + * interested in starting the job before this time. * @param duration the duration of the request. * @param reqPE the number of processing elements required. * @return <tt>true</tt> if the request can be scheduled, * or <tt>false</tt> otherwise. */ - public boolean canSchedule(double startTime, int duration, int reqPE) { - - // calculate the reservation's finish time - double finishTime = startTime + duration; - - // a pointer to the anchor entry (described above) - AvailabilityInfoEntry anchorEntry = null; - - // the list of selected ranges - PERangeList intersectList = null; - - intersectList = null; - int length = super.size(); - double entryTime; - - int anchorIndex = -1; - - Iterator<AvailabilityInfoEntry> it = super.iterator(); - while(it.hasNext()) { - AvailabilityInfoEntry entry = it.next(); - entryTime = entry.getTime(); - if(entryTime > startTime) { - break; - } - else { - anchorEntry = entry; - } - } - - intersectList = (anchorEntry != null ) ? - anchorEntry.getAvailRanges().clone() : null; - - if(intersectList == null || intersectList.getNumPE() < reqPE) { - // there are not enough PEs available to serve the - // advance reservation request, then returns null - return false; - } - - anchorIndex = super.indexOf(anchorEntry); - - // Look for the intersection of available ranges from - // the anchor until the end of the profile or until - // the entries are further than the expected completion time - for(int i=anchorIndex+1; i<length; i++) { - AvailabilityInfoEntry nextEntry = super.get(i); - if(nextEntry.getTime() > finishTime){ - break; - } - else { - // if the finish time is equals to the entry time, so there - // is no need to check the intersection - if(nextEntry.getTime() < finishTime) { - intersectList = PERangeList.intersection(intersectList, - nextEntry.getAvailRanges()); - } - } - - if(intersectList == null || intersectList.getNumPE() < reqPE) { - // there are not enough PEs available to serve the - // advance reservation request, then returns null - return false; - } - } - - return true; + public boolean canSchedule(double readyTime, int duration, int reqPE) { + return canSchedule(readyTime, Double.MAX_VALUE, duration, reqPE); } /** @@ -300,19 +360,21 @@ * can be scheduled or not. The method verifies whether there are enough * processing elements during ready time until the deadline for the * specified duration. - * @param readyTime the start time of the request. - * @param deadline the deadline of the request + * @param readyTime the start time of the request. This is the time before + * which, the request will not be ready for scheduling. The user is not + * interested in starting the job before this time. + * @param deadline the deadline of the request. * @param duration the duration of the request. * @param reqPE the number of processing elements required. * @return <tt>true</tt> if the request can be scheduled, * or <tt>false</tt> otherwise. */ public boolean canSchedule(double readyTime, double deadline, - int duration, int reqPE) { + int duration, int reqPE) { - if(duration < deadline - readyTime) { + if(duration > (deadline - readyTime)) { System.out.println("AvailabilityInfo.canSchedule(): Duration cannot " + - "be smaller than (deadline - readyTime)."); + "be larger than (deadline - readyTime)."); return false; } else if(deadline < readyTime) { @@ -321,67 +383,8 @@ return false; } - // the list of selected ranges - PERangeList intersectList = null; - int length = super.size(); - double entryTime; - - int anchorIndex = -1; - - Iterator<AvailabilityInfoEntry> it = super.iterator(); - while(it.hasNext()) { - AvailabilityInfoEntry entry = it.next(); - entryTime = entry.getTime(); - if(entryTime < readyTime) { - continue; - } - - // calculate the reservation's finish time - double finishTime = entryTime + duration; - if(finishTime > deadline) { - return false; - } - - if(entry.getNumPE() < reqPE) { - continue; - } - else { - anchorIndex = super.indexOf(entry); - intersectList = entry.getAvailRanges().clone(); - - // Look for the intersection of available ranges from - // the anchor until the end of the profile or until - // the entries are further than the expected completion time - for(int i=anchorIndex+1; i<length; i++) { - AvailabilityInfoEntry nextEntry = super.get(i); - if(nextEntry.getTime() > finishTime){ - break; - } - else { - // if the finish time is equals to the entry time, so there - // is no need to check the intersection - if(nextEntry.getTime() < finishTime) { - intersectList = PERangeList.intersection(intersectList, - nextEntry.getAvailRanges()); - } - } - - if(intersectList == null || intersectList.getNumPE() < reqPE) { - // there are not enough PEs available to serve the - // advance reservation request, then returns null - break; - } - } - } - } - - if(intersectList == null || intersectList.getNumPE() < reqPE) { - // there are not enough PEs available to serve the - // advance reservation request, then returns null - return false; - } - - return true; + double potStartTime = getPotentialStartTime(readyTime, duration, reqPE, deadline); + return potStartTime > UNKNOWN ? true : false; } /** @@ -403,57 +406,72 @@ LinkedList<TimeSlot> slots = new LinkedList<TimeSlot>(); // start time cannot be smaller than the start time of the info obj - if(startTime < startTime_) + if(startTime < startTime_) { startTime = startTime_; - + } // start time cannot be larger than the finish time of the info obj - if(startTime > finishTime_) { + else if(startTime > finishTime_) { return slots; } + + // the finish time cannot be larger than this object finish time + if(finishTime > finishTime_) { + finishTime = finishTime_; + } AvailabilityInfoEntry entry = getPrecedingEntry(startTime); AvailabilityInfoEntry nextEntry = null; PERangeList slotRanges = null; PERangeList intersect = null; int size = super.size(); + int firstIndex = super.indexOf(entry); - for(int i=super.indexOf(entry); i<size; i++) { + if(firstIndex < 0) + firstIndex = 0; + + for(int i=firstIndex; i<size; i++) { entry = super.get(i); + if(entry.getTime() >= finishTime) { break; } else if (entry.getNumPE() == 0) { continue; } - - double slotStart = - entry.getTime() < startTime ? startTime : entry.getTime(); + slotRanges = entry.getAvailRanges(); + double slotStart = Math.max(entry.getTime(), startTime); - for(int j=i; j<size; j++) { - nextEntry = super.get(j); - intersect = PERangeList.intersection(slotRanges, nextEntry.getAvailRanges()); - double endTime = entry.getTime(); - boolean different = !intersect.equals(slotRanges); - if(j < (size-1) && different) { - if((endTime - slotStart) >= duration && slotRanges.getNumPE() >= numPEs) { - TimeSlot slot = new TimeSlot(slotStart, endTime, slotRanges); - slots.add(slot); + do { + int initialPE = slotRanges.getNumPE(); + + for(int j=i+1; j<size; j++) { + nextEntry = super.get(j); + intersect = PERangeList.intersection(slotRanges, nextEntry.getAvailRanges()); + + // if there was a change in the number of PEs, so that less PEs are available + // after the next entry, then considers the next entry as the end of the + // current time slot + if(intersect == null || intersect.getNumPE() < slotRanges.getNumPE()) { + double endTime = Math.min(nextEntry.getTime(), finishTime); + if((endTime - slotStart) >= duration && slotRanges.getNumPE() >= numPEs) { + TimeSlot slot = new TimeSlot(slotStart, endTime, slotRanges.clone()); + slots.add(slot); + } + slotRanges = intersect; + break; } - slotRanges = intersect; } - else if (j == (size-1)) { - if((endTime - slotStart) >= duration && slotRanges.getNumPE() >= numPEs) { - TimeSlot slot = new TimeSlot(slotStart, finishTime, slotRanges); + + if(slotRanges != null && slotRanges.getNumPE() == initialPE) { + if((finishTime - slotStart) >= duration && slotRanges.getNumPE() >= numPEs) { + TimeSlot slot = new TimeSlot(slotStart, finishTime, slotRanges.clone()); slots.add(slot); } - continue; + slotRanges = null; } - if(intersect == null && intersect.getNumPE() == 0) { - break; - } - } + } while(slotRanges != null && slotRanges.getNumPE() > 0); } return slots; Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/TimeSlot.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/TimeSlot.java 2008-06-13 00:55:20 UTC (rev 183) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/TimeSlot.java 2008-06-17 07:21:14 UTC (rev 184) @@ -117,4 +117,13 @@ public int getNumPE() { return ranges_ == null ? 0 : ranges_.getNumPE(); } + + /** + * Creates a string representation of the list + * @return a string representation + */ + public String toString() { + return "TimeSlot={startTime=" + startTime_ + + ", finishTime=" + finishTime_ + ", ranges=" + ranges_ + "}"; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-06-13 00:55:13
|
Revision: 183 http://gridsim.svn.sourceforge.net/gridsim/?rev=183&view=rev Author: marcos_dias Date: 2008-06-12 17:55:20 -0700 (Thu, 12 Jun 2008) Log Message: ----------- This update contains a few changes in the workload model, which allows one to extend the model in an easier way. It also provides the capability to query for particular free time slots from providers. Modified Paths: -------------- branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java branches/gridsim4.0-branch3/source/gridsim/turbo/SSGridlet.java branches/gridsim4.0-branch3/source/gridsim/turbo/WorkloadInterface.java Modified: branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java =================================================================== --- branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java 2008-06-13 00:55:20 UTC (rev 183) @@ -69,6 +69,7 @@ int rating = 377; // rating of each PE in MIPS int totalPE = 9; // total number of PEs for each Machine int totalMachine = 128; // total number of Machines + int i = 0; String[] resArray = new String[totalResource]; @@ -93,11 +94,19 @@ // uHi is going to contain log2 of the maximum number of PEs that a // parallel job can require double uHi = Math.log(totalPE * totalMachine) / Math.log(2d); - double uMed = uHi-2.5; - + + /* Here we modify the number of nodes required by parallel jobs + * as an example */ + double uMed = uHi-3.5; workload.setParallelJobProbabilities(Lublin99Workload.INTERACTIVE_JOBS, workload.getParallelJobULow(Lublin99Workload.INTERACTIVE_JOBS), uMed, uHi, workload.getParallelJobUProb(Lublin99Workload.INTERACTIVE_JOBS)); + + /* Here we modify the inter-arrival time for jobs as an example */ +// workload.setInterArrivalTimeParameters(Lublin99Workload.INTERACTIVE_JOBS, +// Lublin99Workload.AARR, 0.55D, +// Lublin99Workload.ANUM, Lublin99Workload.BNUM, +// Lublin99Workload.ARAR); // sets the workload to create 1000 jobs workload.setNumJobs(1000); Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-06-13 00:55:20 UTC (rev 183) @@ -391,10 +391,15 @@ * they are not the scheduling options for jobs. * @param startTime the start time of the period. * @param finishTime the finish time of the period. + * @param duration the minimum duration of the free time slots. Free time slots + * whose time frame is smaller than <tt>duration</tt> will be ignored. + * @param numPEs the minimum number of PEs of the free time slots. Free time slots + * whose number of PEs is smaller than <tt>numPEs</tt> will be ignored. * @return a linked list with the time slots contained in this availability * information object within a specified period of time. */ - public LinkedList<TimeSlot> getSchedulingOptions(double startTime, double finishTime) { + public LinkedList<TimeSlot> getSchedulingOptions(double startTime, + double finishTime, int duration, int numPEs) { LinkedList<TimeSlot> slots = new LinkedList<TimeSlot>(); // start time cannot be smaller than the start time of the info obj @@ -431,13 +436,17 @@ double endTime = entry.getTime(); boolean different = !intersect.equals(slotRanges); if(j < (size-1) && different) { - TimeSlot slot = new TimeSlot(slotStart, endTime, slotRanges); - slots.add(slot); + if((endTime - slotStart) >= duration && slotRanges.getNumPE() >= numPEs) { + TimeSlot slot = new TimeSlot(slotStart, endTime, slotRanges); + slots.add(slot); + } slotRanges = intersect; } else if (j == (size-1)) { - TimeSlot slot = new TimeSlot(slotStart, finishTime, slotRanges); - slots.add(slot); + if((endTime - slotStart) >= duration && slotRanges.getNumPE() >= numPEs) { + TimeSlot slot = new TimeSlot(slotStart, finishTime, slotRanges); + slots.add(slot); + } continue; } Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java 2008-06-13 00:55:20 UTC (rev 183) @@ -47,6 +47,168 @@ * specification. * </ul> * <p> + * Details on how the distributions have been implemented and how their + * parameters can be configured are described below. Please note that this text + * was extracted from the C implementation of the model performed by Uri Lublin + * and Dror Feitelson: + * + * <p> + * The load generated can be changed by changing the values of the model parameters. + * Remember to set the number-of-nodes' parameters to fit your system. + * I distinguish between the two different types (batch or interactive) if the + * useJobType in the constructors is set to <tt>true</tt>. The program starts + * by initialising the model's parameters (according to the following constants + * definitions -- parameters values). Notice that if job type is set to + * <tt>true</tt>, there are different values to batch-parameters and + * interactive-parameters, and if this flag is <tt>false</tt> then they both get + * the same value (and the arbitrary type interactive). The workload calculates + * for each job its arrival arrival time (using 2 gamma distributions), + * number of nodes (using a two-stage-uniform distribution), runtime + * (using the number of nodes and hyper-gamma distribution) and type. + * + * <p> + * Some definitions: + * <ul> + * <li> 'l' - the mean load of the system + * <li> 'r' - the mean runtime of a job + * <li> 'ri' - the runtime of job 'i' + * <li> 'n' - the mean number of nodes of a job + * <li> 'ni' - the number of nodes of job 'i' + * <li> 'a' - the mean inter-arrival time of a job + * <li> 'ai' - the arrival time (from the beginning of the simulation) of job 'i' + * <li> 'P' - the number of nodes in the system (the system's size). + * </ul> + * + * Given ri,ni,ai,N or r,n,a,N we can calculate the expected load on the system + * + * <p> + * <tt> + * sum(ri * ni) + * load = --------------- + * P * max(ai) + * </tt> + * + * <p> + * We can calculate an approximation (exact if 'ri' and 'ni' are independent) + * + *<p> + *<tt> + * r * n + * approximate-load = ------- + * P * a + *</tt> + * + * <p> + * The model controls the r,m,a. + * One can change them by changing the values of the model's parameters. + * + * <p> + * ---------------------- <br> + * Changing the runtime: <br> + * ---------------------- <br> + * Let g ~ gamma(alpha,beta) then the expectation and variation of g are:<br> + * E(g) = alpha*beta ; Var(g) = alpha*(beta^2)<br> + * so the coefficient of variation is CV = sqrt(Var(g))/E(g) = 1/sqrt(alpha). + * One who wishes to enlarge the gamma random value without changing the CV + * can set a larger value to the parameter beta . If one wishes that the CV will + * change he may set a larger value to alpha parameter. + * Let hg ~ hyper-gamma(a1,b1,a2,b2,p) then the expectation and variation are: <br> + * E(hg) = p*a1*b1 + (1-p)*a2*b2<br> + * Var(hg) = p^2*a1*b1^2 + (1-p)^2*a2*b2^2<br> + * One who wishes to enlarge the hyper-gamma (or the runtime) random value may + * do that using one (or more) of the three following ways:<br> + * 1. enlarge the first gamma.<br> + * 2. and/or enlarge the second gamma.<br> + * 3. and/or set a smaller value to the 'p' parameter.(parameter p of hyper-gamma + * is the proportion of the first gamma). + * since in my model 'p' is dependent on the number of nodes (p=pa*nodes+pb) + * this is done by diminishing 'pa' and/or diminishing 'pb' such that 'p' + * will be smaller. Note that changing 'pa' affects the correlation + * between the number of nodes a job needs and its runtime. <br> + * <br> + * Use {@link #setRunTimeParameters(int, double, double, double, double, double, double)} + * in order to change the runtime parameters of jobs. + * + * <p> + * ------------------------ <br> + * Changing the correlation between the number of nodes a job needs and its runtime: <br> + * ------------------------ <br> + * The parameter 'pa' is responsible for that correlation. Since its negative + * as the number of nodes get larger so is the runtime. + * One who wishes no correlation between the nodes-number and the runtime should + * set 'pa' to be 0 or a small negative number close to 0. + * One who wishes to have strong such a correlation should set 'pa' to be not so + * close to 0 , for example -0.05 or -0.1 . Note that this affect the runtime + * which will be larger. One can take care of that by changing the other runtime + * parameters (a1,b1,a2,b2,pb). <br> + * + * <p> + * ----------------------------- <br> + * Changing the number of nodes: <br> + * ----------------------------- <br> + * Let u ~ uniform(a,b) then the expectation of u is E(u) = (a+b)/2. <br> + * Let tsu ~ two-stage-uniform(Ulow,Umed,Uhi,Uprob) then the expectation of tsu + * is E(tsu) = Uprob*(Ulow+Umed)/2 + (1-Uprob)*(Umed+Uhi)/2 = + * = (Uprob*Ulow + Umed + (1-Uprob)*Uhi)/2. <br> + * 'Ulow' is the log2 of the minimal number of nodes a job may run on. <br> + * 'Uhi' is the log2 of the system size. <br> + * 'Umed' is the changing point of the cdf function and should be set to <br> + * 'Umed' = 'Uhi' - 2.5. ('2.5' could be change between 1.5 to 3.5). <br> + * For example if the system size is 8 (Uhi = log2(8) = 3) its make no sense to + * set Umed to be 0 or 0.5 . In this case I would set Umed to be 1.5 , and maybe + * set Ulow to be 0.8 , so the probability of 2 would not be too small. + * 'Uprob' is the proportion of the first uniform (Ulow,Umed) and should be set + * to a value between 0.7 to 0.95. + *<br> + * One who wishes to enlarge the mean number of nodes may do that using one of + * the two following ways:<br> + * 1. set a smaller value to 'prob'<br> + * 2. and/or enlarge 'med'<br> + * Remember that changing the mean number of nodes will affect on the runtime + * too. <br> + * Use {@link #setParallelJobProbabilities(int, double, double, double, double)} + * to change the number of nodes and probability of parallel jobs. <br> + * Use {@link #setPower2Probability(int, double)} to change the probability of + * power of two jobs. <br> + * Use {@link #setSerialProbability(int, double)} to change the probability for + * serial or sequential jobs. <br> + * + * <p> + * -------------------------- <br> + * Changing the arrival time: <br> + * -------------------------- <br> + * The arrival time is calculated in two stages: <br> + * First stage : calculate the proportion of number of jobs arrived at every + * time interval (bucket). this is done using the gamma(anum,bnum) + * cdf and the CYCLIC_DAY_START. The weights array holds the points + * of all the buckets. <br> + * Second stage: foreach job calculate its inter-arrival time: <br> + * Generate a random value from the gamma(aarr,barr). + * The exponential of the random value is the + * points we have. While we have less points than the current + * bucket , "pay" the appropriate number of points and move to the + * next bucket (updating the next-arrival-time). + * <br> + * The parameters 'aarr' and 'barr' represent the inter-arrival-time in the + * rush hours. The parameters 'anum' and 'bnum' represent the number of jobs + * arrived (for every bucket). The proportion of bucket 'i' is: + * cdf (i+0.5 , anum , bnum) - cdf(i-0.5 , anum , bnum). + * We calculate this proportion foreach i from BUCKETS to (24+BUCKETS) , + * and the buckets (their indices) that are larger than or equal to 24 are move + * cyclically to the right place: + * (24 --> 0 , 25 --> 1 , ... , (24+BUCKETS) --> BUCKETS ) + * <br> + * One who wishes to change the mean inter-arrival time may do that in the + * following way: <br> + * - enlarge the rush-hours-inter-arrival time. + * This is done by enlarging the value of aarr or barr according to the wanted + * change of the CV. <br> + * One who wishes to change the daily cycle may change the values of 'anum' + * and/or 'bnum'<br> + * Use {@link #setInterArrivalTimeParameters(int, double, double, double, double, double)} + * to change the inter-arrival parameters. + * + * <p> * For more information on the workload model implemented here, please read * the following paper: <br> * Uri Lublin and Dror G. Feitelson, The Workload on Parallel Supercomputers: @@ -111,32 +273,40 @@ // ------------------- MODEL DEFAULT PARAMETERS ----------------------- - /* The parameters for number of nodes: - * serial_prob is the proportion of the serial jobs - * pow2_prob is the proportion of the jobs with power 2 number of nodes - * ULow , UMed , UHi and Uprob are the parameters for the two-stage-uniform - * which is used to calculate the number of nodes for parallel jobs. - * ULow is the log2 of the minimal size of job in the system (you can add or - * subtract 0.2 to give less/more probability to the minimal size) . - * UHi is the log2 of the maximal size of a job in the system (system's size) - * UMed should be in [UHi-1.5 , UHi-3.5] - * Uprob should be in [0.7 - 0.95] - */ - private static final double SERIAL_PROB_BATCH = 0.2927; - private static final double POW2_PROB_BATCH = 0.6686; - private static final double ULOW_BATCH = 1.2f; // smallest parallel batch job has 2 nodes - private static final double UMED_BATCH = 5; - private static final double UHI_BATCH = 7; // biggest batch job has 128 nodes - private static final double UPROB_BATCH = 0.875; + /** The default proportion of batch serial jobs */ + public static final double SERIAL_PROB_BATCH = 0.2927; + /** The default proportion of batch jobs with power 2 number of nodes */ + public static final double POW2_PROB_BATCH = 0.6686; + + /** ULow, UMed, UHi and Uprob are the parameters for the two-stage-uniform + * which is used to calculate the number of nodes for parallel jobs. + * ULow is the default log2 of the minimal size of job in the system for batch jobs. */ + public static final double ULOW_BATCH = 1.2f; // smallest parallel batch job has 2 nodes + /** UHi is the default log2 of the maximal size of a batch job in the system (system's size) */ + public static final double UHI_BATCH = 7; // biggest batch job has 128 nodes + /** Default UMed for batch jobs. Note that UMed should be in [UHi-1.5 , UHi-3.5] */ + public static final double UMED_BATCH = 5; + /** Default UProb for batch jobs. Note that Uprob should be in [0.7 - 0.95] */ + public static final double UPROB_BATCH = 0.875; - private static final double SERIAL_PROB_ACTIVE = 0.1541; - private static final double POW2_PROB_ACTIVE = 0.625; - private static final double ULOW_ACTIVE = 1; // smallest interactive parallel job has 2 nodes - private static final double UMED_ACTIVE = 3; - private static final double UHI_ACTIVE = 5.5f; // biggest interactive job has 45 nodes - private static final double UPROB_ACTIVE = 0.705; + /** The default proportion of interactive serial jobs */ + public static final double SERIAL_PROB_ACTIVE = 0.1541; + /** The default proportion of interactive jobs with power 2 number of nodes */ + public static final double POW2_PROB_ACTIVE = 0.625; - /* The parameters for the running time + /** ULow, UMed, UHi and Uprob are the parameters for the two-stage-uniform + * which is used to calculate the number of nodes for parallel jobs. + * ULow is the default log2 of the minimal size of job in the system for interactive jobs. */ + public static final double ULOW_ACTIVE = 1; // smallest interactive parallel job has 2 nodes + /** UHi is the default log2 of the maximal size of an interactive job in the system (system's size) */ + public static final double UHI_ACTIVE = 5.5f; // biggest interactive job has 45 nodes + /** Default UMed for interactive jobs. Note that UMed should be in [UHi-1.5 , UHi-3.5] */ + public static final double UMED_ACTIVE = 3; + /** Default UProb for interactive jobs. Note that Uprob should be in [0.7 - 0.95] */ + public static final double UPROB_ACTIVE = 0.705; + + /** + * The parameters for the running time * The running time is computed using hyper-gamma distribution. * The parameters a1,b1,a2,b2 are the parameters of the two gamma distributions * The p parameter of the hyper-gamma distribution is calculated as a straight @@ -144,19 +314,19 @@ * 'nodes' will be calculated in the program, here we defined the 'pa','pb' * parameters. */ - private static final double A1_BATCH = 6.57; - private static final double B1_BATCH = 0.823; - private static final double A2_BATCH = 639.1; - private static final double B2_BATCH = 0.0156; - private static final double PA_BATCH = -0.003; - private static final double PB_BATCH = 0.6986; + public static final double A1_BATCH = 6.57; + public static final double B1_BATCH = 0.823; + public static final double A2_BATCH = 639.1; + public static final double B2_BATCH = 0.0156; + public static final double PA_BATCH = -0.003; + public static final double PB_BATCH = 0.6986; - private static final double A1_ACTIVE = 3.8351; - private static final double B1_ACTIVE = 0.6605; - private static final double A2_ACTIVE = 7.073; - private static final double B2_ACTIVE = 0.6856; - private static final double PA_ACTIVE = -0.0118; - private static final double PB_ACTIVE = 0.9156; + public static final double A1_ACTIVE = 3.8351; + public static final double B1_ACTIVE = 0.6605; + public static final double A2_ACTIVE = 7.073; + public static final double B2_ACTIVE = 0.6856; + public static final double PA_ACTIVE = -0.0118; + public static final double PB_ACTIVE = 0.9156; /* The parameters for the inter-arrival time @@ -170,41 +340,41 @@ * a constant ,ARAR (Arrive-Rush-All-Ratio), to set the alpha parameter (the new * aarr) so it will represent the arrive-time at all hours of the day. */ - private static final double AARR_BATCH = 6.0415; - private static final double BARR_BATCH = 0.8531; - private static final double ANUM_BATCH = 6.1271; - private static final double BNUM_BATCH = 5.2740; - private static final double ARAR_BATCH = 1.0519; + public static final double AARR_BATCH = 6.0415; + public static final double BARR_BATCH = 0.8531; + public static final double ANUM_BATCH = 6.1271; + public static final double BNUM_BATCH = 5.2740; + public static final double ARAR_BATCH = 1.0519; - private static final double AARR_ACTIVE = 6.5510; - private static final double BARR_ACTIVE = 0.6621; - private static final double ANUM_ACTIVE = 8.9186; - private static final double BNUM_ACTIVE = 3.6680; - private static final double ARAR_ACTIVE = 0.9797; + public static final double AARR_ACTIVE = 6.5510; + public static final double BARR_ACTIVE = 0.6621; + public static final double ANUM_ACTIVE = 8.9186; + public static final double BNUM_ACTIVE = 3.6680; + public static final double ARAR_ACTIVE = 0.9797; /* * Here are the model's parameters for typeless data (no batch nor interactive) * We use those parameters when useJobType_ is false */ - private static final double SERIAL_PROB = 0.244; - private static final double POW2_PROB = 0.576; - private static final double ULOW = 0.8f; // The smallest parallel job is 2 nodes - private static final double UMED = 4.5f; - private static final double UHI = 7f; // SYSTEM SIZE is 2^UHI == 128 - private static final double UPROB = 0.86; + public static final double SERIAL_PROB = 0.244; + public static final double POW2_PROB = 0.576; + public static final double ULOW = 0.8f; // The smallest parallel job is 2 nodes + public static final double UMED = 4.5f; + public static final double UHI = 7f; // SYSTEM SIZE is 2^UHI == 128 + public static final double UPROB = 0.86; - private static final double A1 = 4.2; - private static final double B1 = 0.94; - private static final double A2 = 312; - private static final double B2 = 0.03; - private static final double PA = -0.0054; - private static final double PB = 0.78; + public static final double A1 = 4.2; + public static final double B1 = 0.94; + public static final double A2 = 312; + public static final double B2 = 0.03; + public static final double PA = -0.0054; + public static final double PB = 0.78; - private static final double AARR = 10.2303; - private static final double BARR = 0.4871; - private static final double ANUM = 8.1737; - private static final double BNUM = 3.9631; - private static final double ARAR = 1.0225; + public static final double AARR = 10.2303; + public static final double BARR = 0.4871; + public static final double ANUM = 8.1737; + public static final double BNUM = 3.9631; + public static final double ARAR = 1.0225; // start the simulation at midnight (hour 0) private static final int START = 0; @@ -515,13 +685,15 @@ barr[BATCH_JOBS] = barr[INTERACTIVE_JOBS] = BARR; anum[BATCH_JOBS] = anum[INTERACTIVE_JOBS] = ANUM; bnum[BATCH_JOBS] = bnum[INTERACTIVE_JOBS] = BNUM; + + timeFromBegin_[BATCH_JOBS] = Long.MAX_VALUE; } // if ( ! useJobType_ ) // make all jobs batch // timeFromBegin_[INTERACTIVE_JOBS] = Long.MAX_VALUE; - if ( ! useJobType_ ) // make all jobs interactive - timeFromBegin_[BATCH_JOBS] = Long.MAX_VALUE; +// if ( ! useJobType_ ) // make all jobs interactive +// timeFromBegin_[BATCH_JOBS] = Long.MAX_VALUE; } /** @@ -760,17 +932,25 @@ } /** - * Sets the parameters for the inter-arrival time - * The inter-arriving time is calculated using two gamma distributions. - * gamma(aarr,barr) represents the inter_arrival time for the rush hours. - * It is independent on the hour the job arrived at. - * The cdf of gamma(bnum,anum) represents the proportion of number of jobs - * which arrived at each time interval (bucket). - * The inter-arrival time is calculated using both gammas - * Since gamma(aarr,barr) represents the arrive-time at the rush time, - * we use a constant, ARAR (Arrive-Rush-All-Ratio), to set the alpha - * parameter (the new aarr) so it will represent the arrive-time at all - * hours of the day. + * Sets the parameters for the inter-arrival time. <br> + * The inter-arrival time is calculated using two gamma distributions. + * gamma(aarr,barr) represents the inter-arrival time for the rush hours. + * It is independent on the hour the job arrived at. The cdf of + * gamma(bnum,anum) represents the proportion of number of jobs which + * arrived at each time interval (bucket). The inter-arrival time is + * calculated using both gammas. Since gamma(aarr,barr) represents the + * arrival-time at the rush time, we use a constant, ARAR + * (Arrive-Rush-All-Ratio), to set the alpha parameter (the new aarr) + * so it will represent the arrive-time at all hours of the day. + * @param jobType the type of job for which the inter-arrival parameters + * will be modified. + * @param aarr the first parameter for gamma(aarr,barr) distribution + * @param barr the second parameter for gamma(aarr,barr) distribution + * @param anum the first parameter for gamma(bnum,anum) distribution + * @param bnum the second parameter for gamma(bnum,anum) distribution + * @param arar Arrive-Rush-All-Ratio + * @return <tt>true</tt> if the parameters have been set; + * <tt>false</tt> if they have not been set. */ public boolean setInterArrivalTimeParameters(int jobType, double aarr, double barr, double anum, double bnum, double arar) { @@ -842,7 +1022,7 @@ * The workload model will stop when it approaches workloadDuration. * @param workloadDuration the maximum duration of the workload. * @return <tt>true</tt> if the duration has been set; - * <tt>false</tt> othwerwise. + * <tt>false</tt> otherwise. */ public boolean setMaximumWorkloadDuration(double workloadDuration) { if(workloadDuration <= 0) @@ -1153,8 +1333,10 @@ par = twoStageUniform(uLow, uMed, uHi, uProb); if (u <= (serialProb + pow2Prob)) // power of 2 nodes parallel job par = (int)(par + 0.5); // par = round(par) - - return (int)(Math.pow(2, par) + 0.5); // return round(2^par) + + int numNodes = (int)(Math.pow(2, par) + 0.5); // round(2^par) + int maxNodes = (int)(Math.pow(2, uHi) + 0.5); + return numNodes <= maxNodes ? numNodes : maxNodes; } /* @@ -1345,9 +1527,9 @@ } - // --- Methods required by the distributions used by the workload model --- - // --- Most of these methods were ported from C to Java, but the logic --- - // --- remains the same as in Lublin's workload model in C --- + // --- Methods required by the distributions used by the workload model --- + // --- Most of these methods were ported from C to Java, but the logic --- + // --- remains the same as in Lublin's workload model in originally in C --- /* * hyperGamma returns a value of a random variable of mixture of two @@ -1421,22 +1603,6 @@ return (beta * x * y); } -// /* -// * betarndLess1 returns a value of a random variable of beta(alpha,beta) -// * distribution where both alpha and beta are smaller than 1 (and larger -// * than 0) -// */ -// private double betarndLess1(double alpha, double beta) { -// double x, y, u1, u2; -// do { -// u1 = random_.nextDouble(); -// u2 = random_.nextDouble(); -// x = Math.pow(u1, 1 / alpha); -// y = Math.pow(u2, 1 / beta); -// } while (x + y > 1); -// return (x / (x + y)); -// } - /* * betarndLess1 returns a value of a random variable of beta(alpha,beta) * distribution where both alpha and beta are smaller than 1 (and larger @@ -1543,38 +1709,51 @@ return tsu; } +// /* +// * Natural logarithm of gamma function +// */ +// static double logGamma(double x) { +// double tmp = (x - 0.5) * Math.log(x + 4.5) - (x + 4.5); +// double ser = 1.0 + 76.18009173 / (x + 0) - 86.50532033 / (x + 1) +// + 24.01409822 / (x + 2) - 1.231739516 / (x + 3) +// + 0.00120858003 / (x + 4) - 0.00000536382 / (x + 5); +// return tmp + Math.log(ser * Math.sqrt(2 * Math.PI)); +// } + + private double A[] = { + 8.11614167470508450300E-4, + -5.95061904284301438324E-4, + 7.93650340457716943945E-4, + -2.77777777730099687205E-3, + 8.33333333333331927722E-2 }; + + private double B[] = { + -1.37825152569120859100E3, + -3.88016315134637840924E4, + -3.31612992738871184744E5, + -1.16237097492762307383E6, + -1.72173700820839662146E6, + -8.53555664245765465627E5 }; + + private double C[] = { + // 1.00000000000000000000E0, + -3.51815701436523470549E2, + -1.70642106651881159223E4, + -2.20528590553854454839E5, + -1.13933444367982507207E6, + -2.53252307177582951285E6, + -2.01889141433532773231E6 }; + /* * Natural logarithm of gamma function * Cephes Math Library Release 2.2: July, 1992 * Copyright 1984, 1987, 1989, 1992 by Stephen L. Moshier * Direct inquiries to 30 Frost Street, Cambridge, MA 02140 */ - static private double logGamma(double x) + private double logGamma(double x) throws ArithmeticException { double p, q, w, z; - double A[] = { 8.11614167470508450300E-4, - -5.95061904284301438324E-4, - 7.93650340457716943945E-4, - -2.77777777730099687205E-3, - 8.33333333333331927722E-2 }; - - double B[] = { -1.37825152569120859100E3, - -3.88016315134637840924E4, - -3.31612992738871184744E5, - -1.16237097492762307383E6, - -1.72173700820839662146E6, - -8.53555664245765465627E5 }; - - double C[] = { - // 1.00000000000000000000E0, - -3.51815701436523470549E2, - -1.70642106651881159223E4, - -2.20528590553854454839E5, - -1.13933444367982507207E6, - -2.53252307177582951285E6, - -2.01889141433532773231E6 }; - if (x < -34.0) { q = -x; w = logGamma(q); @@ -1631,7 +1810,7 @@ return q; } - static private double polevl(double x, double coef[], int N) + private double polevl(double x, double coef[], int N) throws ArithmeticException { double ans; ans = coef[0]; @@ -1641,7 +1820,7 @@ return ans; } - static private double p1evl(double x, double coef[], int N) + private double p1evl(double x, double coef[], int N) throws ArithmeticException { double ans; ans = x + coef[0]; Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/SSGridlet.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/SSGridlet.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/SSGridlet.java 2008-06-13 00:55:20 UTC (rev 183) @@ -411,7 +411,7 @@ /** * Gets the submission or arrival time of this Gridlet from * the latest GridResource - * @return the submission time or <tt>0.0</tt> if nono + * @return the submission time or <tt>0.0</tt> if none */ public double getSubmissionTime() { return gridlet_.getSubmissionTime(); Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/WorkloadInterface.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/WorkloadInterface.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/WorkloadInterface.java 2008-06-13 00:55:20 UTC (rev 183) @@ -1,6 +1,6 @@ /* * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * Description: GridSim (Grid Simulation) Toolkit for Modelling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2008-05-30 16:56:57
|
Revision: 182 http://gridsim.svn.sourceforge.net/gridsim/?rev=182&view=rev Author: acaminero Date: 2008-05-30 09:57:03 -0700 (Fri, 30 May 2008) Log Message: ----------- modified the code to ignore packets whose sender/receiver IDs are listed in the white list Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FIFO.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbInput.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbRIPRouter.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FIFO.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FIFO.java 2008-05-30 16:54:28 UTC (rev 181) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FIFO.java 2008-05-30 16:57:03 UTC (rev 182) @@ -157,14 +157,13 @@ // for example, src_outputPort_str = Output_SIM_0_User_0 // Check the destination, as I'm not sure if it works like that - int dst = ((FnbNetPacket) pnp).getDestID(); - String dst_str = GridSim.getEntityName(dst); + int dst_inputPort = ((FnbNetPacket) pnp).getDestID(); + String dst_inputPort_str = GridSim.getEntityName(dst_inputPort); - // If one of the ends of this packet is the broker or the GIS - if ((src_outputPort_str.indexOf("Broker") != -1) || - (dst_str.indexOf("Broker") != -1) || - (src_outputPort_str.indexOf("GIS") != -1) || - (dst_str.indexOf("GIS") != -1)) + // if neither the src or the dest of the packet are in the whitelist, then drop the packet + if ((GridSim.fnbWhiteList_.checkList(dst_inputPort) == false) && + (GridSim.fnbWhiteList_.checkList(src_outputPort) == false)) + { /* @@ -184,7 +183,7 @@ System.out.println("\n" + super.get_name() + ": buffer full, and a control packet has been dropped.\n" + " src.output: " + src_outputPort_str + - ". dst_inputPort: " + dst_str + + ". dst_inputPort: " + dst_inputPort_str + "\n HENCE, SIMULATION FINISHED"); System.exit(1); @@ -225,7 +224,7 @@ { // If the destination of the packet is the user, tell the user - entity = GridSim.getEntityId(dst_str); + entity = GridSim.getEntityId(dst_inputPort_str); } Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java 2008-05-30 16:54:28 UTC (rev 181) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbEndToEndPath.java 2008-05-30 16:57:03 UTC (rev 182) @@ -27,14 +27,14 @@ private int srcID; private int classtype; private int totalPkts; // total num of packet that belongs to a group - private int glID; // the id of the gridlet this packet belongs to + private int glID; // the id of the gridlet/file this packet belongs to, /**Creates a new object of this class. Tihs is used in the FnbOutput class. * @param destID destination id * @param sourceID source id * @param classType network service level * @param totalPkts total number of packets this connection is made of - * @param glID the gridlet id + * @param glID the gridlet/file id * */ public FnbEndToEndPath (int destID, int srcID, int classtype, int totalPkts, int glID) { @@ -135,19 +135,19 @@ } - /** Sets the gridlet id of a connection. + /** Sets the gridlet/file id of a connection. * @param g the gridlet id of the connection * */ - public void setGlID(int g) + public void setObjectID(int g) { glID = g; } - /** Gets the gridlet id of a connection. + /** Gets the gridlet/file id of a connection. * @return the gridlet id of the connection * */ - public int getGlID() + public int getObjectID() { return glID; } Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbInput.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbInput.java 2008-05-30 16:54:28 UTC (rev 181) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbInput.java 2008-05-30 16:57:03 UTC (rev 182) @@ -329,7 +329,7 @@ //int pktID = ((FnbNetPacket) np).getID(); //int PrevPktNum; // The pkt Num of the previous packet int pktNum = ((FnbNetPacket) np).getPacketNum(); - int glID = ((FnbNetPacket) np).getGlID(); + int glID = ((FnbNetPacket) np).getObjectID(); srcPktNum = lookForSrcPktNum(src_outputPort, glID); if (srcPktNum == null) Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java 2008-05-30 16:54:28 UTC (rev 181) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbNetPacket.java 2008-05-30 16:57:03 UTC (rev 182) @@ -328,10 +328,10 @@ conn = c; } - /**Returns the gridlet to which this packet belongs*/ - public int getGlID() + /**Returns the gridlet/file to which this packet belongs*/ + public int getObjectID() { - return conn.getGlID(); + return conn.getObjectID(); } } // end class Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java 2008-05-30 16:54:28 UTC (rev 181) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbOutput.java 2008-05-30 16:57:03 UTC (rev 182) @@ -16,6 +16,7 @@ import eduni.simjava.*; import java.util.*; import gridsim.net.fnb.*; +import gridsim.datagrid.*; /** @@ -81,6 +82,8 @@ random_ = null; hasStarted_ = false; packetsGridletsList_ = new ArrayList(); + + System.out.println(super.get_name()); } /** @@ -501,7 +504,7 @@ // Send first and then hold super.sim_schedule(id, GridSimTags.SCHEDULE_NOW, ev.get_tag(), io); - double receiverBaudRate = ( (Input) + double receiverBaudRate = ( (NetIO) //(Input) Sim_system.get_entity(id) ).getBaudRate(); // NOTE: io is in byte and baud rate is in bits. 1 byte = 8 bits @@ -542,6 +545,7 @@ int MTU = link_.getMTU(); int numPackets = (int) Math.ceil(size / (MTU * 1.0)); int glID = 9999; + int fileID = 9999; firstLastPacketsGridlet packGl = new firstLastPacketsGridlet(); FnbEndToEndPath conn; if (obj instanceof Gridlet) @@ -555,11 +559,20 @@ conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets, glID); } + /******* TODO: not yet done + else if (obj instanceof File) // For the datagrid extension + { + fileID = ((File) obj).getRegistrationID(); + System.out.println("FileID: " + fileID); + conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets, fileID); + } + ******/ else { conn = new FnbEndToEndPath(destId, super.get_id(), netServiceType, numPackets); } + // make dummy packets with null data convertIntoPacket(MTU, numPackets, tag, conn); Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbRIPRouter.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbRIPRouter.java 2008-05-30 16:54:28 UTC (rev 181) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbRIPRouter.java 2008-05-30 16:57:03 UTC (rev 182) @@ -536,7 +536,7 @@ { conn = new FnbEndToEndPath(pkt.getDestID(), pkt.getSrcID(), pkt.getNetServiceType(), - numPackets, ((FnbNetPacket) pkt).getGlID()); + numPackets, ((FnbNetPacket) pkt).getObjectID()); } else { Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java 2008-05-30 16:54:28 UTC (rev 181) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbSCFQScheduler.java 2008-05-30 16:57:03 UTC (rev 182) @@ -671,8 +671,8 @@ int src_outputPort; String src_outputPort_str; - int dst_inputPort; - String dst_inputPort_str; + int dst; + String dst_str; int glID; @@ -694,36 +694,49 @@ // for example, src_outputPort_str = Output_SIM_0_User_0 // Check the destination, as I'm not sure if it works like that - dst_inputPort = ((FnbNetPacket) pkt).getDestID(); - dst_inputPort_str = GridSim.getEntityName(dst_inputPort); + dst = ((FnbNetPacket) pkt).getDestID(); + dst_str = GridSim.getEntityName(dst); // We must tell the user, not the other end of the transmission int entity; - if (dst_inputPort_str.indexOf("User") == -1) + if (dst_str.indexOf("User") == -1) { entity = GridSim.getEntityId(src_str); } else { - entity = GridSim.getEntityId(dst_inputPort_str); + entity = GridSim.getEntityId(dst_str); } - // If none of the ends of this packet is the broker or the GIS + /* // This works + // If none of the ends of this packet is the broker or the GIS if ((src_outputPort_str.indexOf("Broker") == -1) && - (dst_inputPort_str.indexOf("Broker") == -1) && + (dst_str.indexOf("Broker") == -1) && (src_outputPort_str.indexOf("GIS") == -1) && - (dst_inputPort_str.indexOf("GIS") == -1)) + (dst_str.indexOf("GIS") == -1) || + (src_outputPort_str.indexOf("RC") != -1) || + (dst_str.indexOf("RC") != -1))*/ + + + // if the src or the dest of the packet are in the whitelist, then try not to drop the packet + if ((GridSim.fnbWhiteList_.checkList(dst) == true) || + (GridSim.fnbWhiteList_.checkList(src_outputPort) == true)) { // To remove a packet form this queue we have to do some stuff // I've copied this from the deque method pktList.remove(i); - timeList.remove(i); if (i == 0) - CF = ( (Double) timeList.remove(0) ).doubleValue(); + { + CF = ((Double) timeList.remove(i)).doubleValue(); + } + else + { + timeList.remove(i); + } // Also, we have to tell the user involved in this transmission // that this packet it's been dropped. - glID = ((FnbNetPacket) pkt).getGlID(); + glID = ((FnbNetPacket) pkt).getObjectID(); if (checkDroppedGlList(glID, entity) == false) { super.send(src_outputPort, GridSimTags.SCHEDULE_NOW, @@ -732,7 +745,7 @@ /*System.out.println("\n" + super.get_name() + ":(make) A packet has been dropped, and an ACK has been sent.\n" + " src.output: " + src_outputPort_str + - ". dst_inputPort: " + dst_inputPort_str + + ". dst: " + dst_str + "\n Time: " + GridSim.clock() + ". PktID: " + pkt.getID() +". Gl: " + glID);*/ @@ -742,7 +755,7 @@ /*System.out.println("\n" + super.get_name() + ":(make) A packet has been dropped.\n" + " src.output: " + src_outputPort_str + - ". dst_inputPort: " + dst_inputPort_str + + ". dst: " + dst_str + "\n Time: " + GridSim.clock() + ". PktID: " + pkt.getID() + ". Gl: " + @@ -756,6 +769,11 @@ }// for (int i = 0; i < size() ; i++) + System.out.println("\n" + super.get_name() + + ":(make) No packet could be dropped.\n" + + "Time: " + GridSim.clock() ); + + return false; } Modified: branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java 2008-05-30 16:54:28 UTC (rev 181) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/RED.java 2008-05-30 16:57:03 UTC (rev 182) @@ -253,15 +253,21 @@ } - // If one of the ends of this packet is the broker or the GIS. + /* + //// This works + // If one of the ends of this packet is the broker or the GIS. // Also, pkts whose source or dest is a router are protected // (monitoring ping packets). And monitoring pkts (from the res monitor) if ((src_outputPort_str.indexOf("Broker") != -1) || (dst_str.indexOf("Broker") != -1) || (src_outputPort_str.indexOf("GIS") != -1) || (dst_str.indexOf("GIS") != -1) || - (src_outputPort_str.indexOf("Router") != -1) || - (dst_str.indexOf("Router") != -1)) + (src_outputPort_str.indexOf("RC") != -1) || + (dst_str.indexOf("RC") != -1))*/ + + // if the src or the dest of the packet are in the whitelist, then try not to drop the packet + if ((GridSim.fnbWhiteList_.checkList(dst) == true) || + (GridSim.fnbWhiteList_.checkList(src_outputPort) == true)) { if (makeRoomForPacket()) @@ -350,7 +356,7 @@ tag = ((FnbNetPacket) pnp).getTag(); // check the user and the gl this packet belongs to - glID = ((FnbNetPacket) pnp).getGlID(); + glID = ((FnbNetPacket) pnp).getObjectID(); } @@ -399,7 +405,7 @@ } else{ - /*System.out.println("\n" + super.get_name() + + /* System.out.println("\n" + super.get_name() + ": A packet has been dropped.\n" + " src.output: " + src_outputPort_str + ". dst_inputPort: " + dst_str + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2008-05-30 16:54:22
|
Revision: 181 http://gridsim.svn.sourceforge.net/gridsim/?rev=181&view=rev Author: acaminero Date: 2008-05-30 09:54:28 -0700 (Fri, 30 May 2008) Log Message: ----------- initial release. this class stores a list of entity IDs and their I/O ports such that their packets are not dropped at the routers. Added Paths: ----------- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbWhiteList.java Added: branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbWhiteList.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbWhiteList.java (rev 0) +++ branches/gridsim4.0-branch2/source/gridsim/net/fnb/FnbWhiteList.java 2008-05-30 16:54:28 UTC (rev 181) @@ -0,0 +1,102 @@ + +package gridsim.net.fnb; + +import java.util.*; +import gridsim.*; + + +public class FnbWhiteList +{ + private ArrayList list_; + + public FnbWhiteList() + { + list_ = new ArrayList(); + } + + + /**Returns true if the given id is in the list.*/ + public boolean checkList(int id) + { + + int id_tmp; + for (int i =0; i<list_.size(); i++) + { + id_tmp = ((Integer)list_.get(i)).intValue(); + + if (id == id_tmp) + { + //System.out.println("----- checking : " + GridSim.getEntityName(id) + " TRUE"); + return true; + } + } + + //System.out.println("----- checking : " + GridSim.getEntityName(id) + " FALSE"); + return false; + + } + + + + public boolean addEntityID(Integer id) + { + // We must add not only the entity id, but also the ids of the input/output ports. + + if ( (id == null) || (id.intValue() <= 0) ) + return false; + + if (checkList(id.intValue()) == true) + return false; + + String name = GridSim.getEntityName(id); + + String input = "Input_" + name; + String output = "Output_" + name; + + int input_id = GridSim.getEntityId(input); + int output_id = GridSim.getEntityId(output); + + list_.add(id); + list_.add(new Integer(input_id)); + list_.add(new Integer(output_id)); + + return true; + } + + + + public boolean addEntityID(int id) + { + return addEntityID(new Integer (id)); + } + + /**Removes the given id of the list.*/ + public boolean removeID(int id) + { + int id_tmp; + for (int i =0; i<list_.size(); i++) + { + id_tmp = ((Integer)list_.get(i)).intValue(); + + if (id == id_tmp) + list_.remove(i); + + } + + return false; + + } + + public int size() + { + return list_.size(); + } + + public Integer get(int i) + { + return (Integer) list_.get(i); + } + + //checkListInputPort(int id) + //checkListOutputPort +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2008-05-30 16:52:35
|
Revision: 180 http://gridsim.svn.sourceforge.net/gridsim/?rev=180&view=rev Author: acaminero Date: 2008-05-30 09:52:24 -0700 (Fri, 30 May 2008) Log Message: ----------- add entities IDs into white list for network buffer Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/GridSimCore.java Modified: branches/gridsim4.0-branch2/source/gridsim/GridSimCore.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/GridSimCore.java 2008-05-30 16:51:15 UTC (rev 179) +++ branches/gridsim4.0-branch2/source/gridsim/GridSimCore.java 2008-05-30 16:52:24 UTC (rev 180) @@ -11,10 +11,12 @@ import eduni.simjava.*; import gridsim.net.*; -import gridsim.net.flow.*; +//import gridsim.net.flow.*; import gridsim.util.*; import java.util.Collection; import gridsim.net.fnb.*; +import gridsim.datagrid.index.*; +import gridsim.index.*; /** @@ -319,8 +321,8 @@ // Flow Level networking has flow input & output else if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_FLOW_LEVEL) { - in = new FlowInput("Input_" + name, baudRate); - out_ = new FlowOutput("Output_" + name, baudRate); + // in = new FlowInput("Input_" + name, baudRate); + // out_ = new FlowOutput("Output_" + name, baudRate); } // Use Finite network buffer else if (GridSimCore.NETWORK_TYPE == @@ -328,6 +330,21 @@ { in = new FnbInput("Input_" + name, baudRate); out_ = new FnbOutput("Output_" + name, baudRate); + + // NOTE: experimental TODO + // check which class or object type it belongs to + if (this instanceof AbstractRC) { + System.out.println(".... It works ... AbstractRC ...."); + GridSim.fnbWhiteList_.addEntityID(this.get_id()); + } + else if (this instanceof AbstractGIS) { + System.out.println(".... It works ... AbstractGIS ...."); + GridSim.fnbWhiteList_.addEntityID(this.get_id()); + } + else if (this instanceof GridInformationService) { + System.out.println(".... It works ... GIS ...."); + GridSim.fnbWhiteList_.addEntityID(this.get_id()); + } } System.out.println(super.get_name() + ".initNetwork()"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2008-05-30 16:51:13
|
Revision: 179 http://gridsim.svn.sourceforge.net/gridsim/?rev=179&view=rev Author: acaminero Date: 2008-05-30 09:51:15 -0700 (Fri, 30 May 2008) Log Message: ----------- add white list of entities IDs and IO ports for network buffer Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/GridSim.java Modified: branches/gridsim4.0-branch2/source/gridsim/GridSim.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/GridSim.java 2008-05-29 16:44:20 UTC (rev 178) +++ branches/gridsim4.0-branch2/source/gridsim/GridSim.java 2008-05-30 16:51:15 UTC (rev 179) @@ -14,8 +14,8 @@ import java.io.*; import java.util.*; import eduni.simjava.*; +import gridsim.net.fnb.*; - /** * This class is mainly responsible in initialization, running and stopping of * the overall simulation. @@ -82,6 +82,8 @@ case GridSimTags.NET_BUFFER_PACKET_LEVEL: GridSimCore.NETWORK_TYPE = GridSimTags.NET_BUFFER_PACKET_LEVEL; + // you create the white list + fnbWhiteList_ = new FnbWhiteList(); break; default: @@ -130,6 +132,7 @@ private static int statsID_ = -1; // id of GridStatistics entity private static Calendar calendar_ = null; // a Calendar object private static GridInformationService gis_ = null; // a GIS object + public static FnbWhiteList fnbWhiteList_ = null; private final static int NOT_FOUND = -1; // a constant //////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |