From: Anthony S. <an...@cs...> - 2008-08-18 12:01:41
|
Hello, The resource scheduler i.e. SpaceShared or TimeShared will update the gridlet length or call Gridlet#setGridletFinishedSoFar() method, according the following conditions: - the gridlet is finished executing - the gridlet is cancelled - the gridlet is migrated to another resource The reason is GridSim is a discrete-event simulation, hence, the simulation time is not continuous, e.g. time = 1, 2, 3, 4, ... Instead, the time jumps based on the arrival of new events, e.g. simulation time = 0, 40, 100, 700, ... Thus, the best way to check the status of a gridlet is by using the GridSim#gridletStatus() method. This method returns the current Gridlet status or -1 if not found. The various Gridlet status can be found in Gridlet class. Note that you should only call this method at a certain interval, not in a loop, since it will slow down the simulation. In addition, the gridlet length will still be zero, until one of the 3 conditions is satisfied. anthony On Wed, 13 Aug 2008, Vinicius Pinheiro wrote: > Hi, > > I'm having problems in getting the amount of computation executed so far. > The method Gridlet.getGridletFinishedSoFar() always return 0. Just when the > Gridlet has finished is that it returns the size of the gridlet, what is > useless at this point. > My code something like: > > while(gridletNotFinished()) { > double amount = gridlet.getGridletFinishedSoFar(); > System.out.println("FinishedSofar: " + amount); > } > > Is there something there I have to do in order to get this method working > properly? > > Thanks in advance, > > Vinicius Pinheiro > |