Hi Innocent,
please note that the GIS entity will not shutdown the simulation until
all user entities have called:
super.shutdownUserEntity();
super.terminateIOEntities();
Hence, the solution is to prevent user entities from invoking these
methods before all jobs are received. You can have a loop in you user
entities testing if all jobs have been received or not, and breaking
from that loop and finally calling the methods above only if all jobs
have been received. In other words, the body of your user entities
should contain something more or less like:
Sim_event ev = new Sim_event();
while (Sim_system.running()) {
sim_get_next(ev);
// process the received event here, if it is a job
// increment a counter for the jobs received
...
// if all the Gridlets have been collected. Note that
// nCompletedJobs is the counter with number of jobs received
// and nSubmittedJobs is a counter with the number of jobs
// dispatched to resources
if (nCompletedJobs == nSubmittedJobs) {
break;
}
}
// shut down all the entities, including GridStatistics entity since
// we used it to record certain events.
shutdownGridStatisticsEntity();
shutdownUserEntity();
terminateIOEntities();
I hope the example helps.
Kind regards,
Marcos
innocent dibia wrote:
>
> Hi Marcos,
> I am simulating a failure environment and I want to delay the GIS
> entity from sending a grid shutdown message until all users in the
> various GIS network has received their jobs back please how can I
> achieve this urgently, please help
>
> thanks
>
>
|