From: Azin M. <az...@ma...> - 2008-06-17 03:09:50
|
Hi, Thanks for your usefull and descriptive response. While I think the solution you proposed can help me I have found where the problem is. When gridletReceive() is invoked while there are actually no events of type GRIDLET_RETURN the program prints "Sim_system: No more future events" and seems to even ignore all other incomming GRIDLET_RETURN events ! Is this the case the famework is supposed to work or I am making a mistake somewhere ?! I really appreciate your attention and descriptive responses you provide Azin Marcos Dias de Assuncao wrote: > >Dear Azin, > >Using a thread will not work as you expect. > >I think that what you want can be implemented in the following >manner. You can create a GridSim entity that submits the gridlets as >you have already created. However, this entity may submit a new >Gridlet whenever a given internal event is received. As an example, I >am providing some sample code wherein the entity schedules a new >Gridlet whenever another returns. The entity's body method would look >like this: > > >public void body() { >... > int numofGrls = 10; > int grlReceived = 0; > > Sim_event ev = new Sim_event(); > while (grlReceived < numofGrls) { > super.sim_get_next(ev); > if(ev.get_src() == super.get_id() && > ev.get_tag() == SUBMIT_ONE_MORE_GRIDLET) { > > // Submit the gridlet here... > super.gridletSubmit(gridlet, resID); > } > else if (ev.get_tag() == GridSimTags.GRIDLET_RETURN) { > // add the gridlet to a list, print it or do whatever is required >here... > grlReceived++; > super.sim_schedule(super.get_id(), > GridSimTags.SCHEDULE_NOW, SUBMIT_ONE_MORE_GRIDLET); > } > } >... >} > > >where SUBMIT_ONE_MORE_GRIDLET is just a new tag defined in the class: > >private static final int SUBMIT_ONE_MORE_GRIDLET = 5000; > >I think this might give you an idea on how it works. > >Regards, > >Marcos > > >On 16/06/2008, at 12:48 PM, Azin Moallem wrote: > >> Hi, >> >> I have a question simulating a scheduling algorithm using GridSim >> and I >> would be greatful to hear back. >> >> I need to simulate a dynamic job submission. I mean while gridlets are >> being submitted to the grid, completed gridlets are being sent back to >> users. To do this I am simulating submission of gridlets in the body >> function of a GridSim entity and receiving back the gridlets is the >> responsibilty of a Thread which I have created myself. >> >> The problem is gridletReceive() always returns null ! and I see this >> output: "Sim_system: No more future events" early in my simulation. >> >> how can i simulate a dynamic job submission environment ? >> >> >> Best, >> Azin >> >> ---------------------------------------------------------------------- >> --- >> Check out the new SourceForge.net Marketplace. >> It's the best place to buy or sell services for >> just about anything Open Source. >> http://sourceforge.net/services/buy/index.php >> _______________________________________________ >> Gridsim-users mailing list >> Gri...@li... >> https://lists.sourceforge.net/lists/listinfo/gridsim-users > > |