From: ye h. <hua...@gm...> - 2009-01-18 19:06:14
|
Hi, all: I am trying to submit some jobs during the LOOP of GridSim class's while (Sim_system.running()) loop. Here is my scenario: Firstly, I comment method interruptedEventFromOutside() to stop external interruptions. In body(), I prepare some jobs by localJobSubmit(), with different start time. The result of job execution is retrieved during the loop of "while (Sim_system.running())", which works fine! Additional, I uncomment interruptedEventFromOutside() to accept addtional jobs during the loop: Sim_system.running(), as soon as new job arrives, i submit the job to corresponding local resource. Now, my problem is, I notified once external gridlets arrive, part of jobs submitted from localJobSubmit() won't be submitted to resource(or return from resource?) I wanner know, whether it's possible to submit addtional jobs during the loop of body().while (Sim_system.running())? I mean, there should be no difference accroding the gridlets themselves, right? Could the gridlets submit from localJobSubmit() and interruptedEventFromOutside() have the same jobId? Or anything else should be paid with attention? Thanks a lot! Regards ye --- scenario snippet --- body() { this.localJobSubmit(); while (Sim_system.running()) { super.sim_get_next(ev); if (ev.get_tag() == GridSimTags.GRIDLET_RETURN){ this.processJobReturnedFromResource(ev.get_data()); continue; } // process other event tags } } private void localJobSubmit() { // prepare some jobs for(Gridlet job : knownGridletList) { // some process here to get a candidate local resource id super.send(resourceId, job.getDelay(), GridSimTags.GRIDLET_SUBMIT, job); } } public void interruptedEventFromOutside(Gridlet job) { // some process here to get a candidate local resource id super.send(resourceId, 0.0, GridSimTags.GRIDLET_SUBMIT, job); } |