From: Marcos D. de A. <ma...@cs...> - 2009-02-16 12:24:02
|
Hi Ye, Please change this part of the code: --------------------------------- if (ev.get_tag() == GridSimTags.GRIDLET_RETURN){ gridlet = (Gridlet) ev.get_data(); super.recordStatistics("[ticking]: Received grildet: " + gridlet.getGridletID() + " from " + resourceName + "\"", gridlet.getProcessingCost()); // stores the received Gridlet into a new GridletList object this.receiveList_.add(gridlet); } --------------------------------- to: --------------------------------- if (ev.get_tag() == GridSimTags.GRIDLET_RETURN){ gridlet = (Gridlet) ev.get_data(); super.recordStatistics("[ticking]: Received grildet: " + gridlet.getGridletID() + " from " + resourceName + "\"", gridlet.getProcessingCost()); // stores the received Gridlet into a new GridletList object this.receiveList_.add(gridlet); if(receiveList_.size() == list_.size()) { break; } } --------------------------------- Otherwise your simulation will never end and you will get those errors. Also, I am sorry, but I could not understand what you want to do in this part of the code: ------------------------------- boolean resubmit = true; // a loop to get one Gridlet at one time and sends it to a grid // resource entity. Then waits for a reply for (int i = 0; i < this.list_.size(); i++) { gridlet = (Gridlet) this.list_.get(i); info = "Gridlet_" + gridlet.getGridletID(); System.out.println("Sending: " + info + " to " + resourceName + " with id = " + resourceID); // Sends one Gridlet to a grid resource specified in "resourceID" // super.gridletSubmit(gridlet, resourceID); // OR another approach to send a gridlet to a grid resource entity super.send(resourceID, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, gridlet); if(resubmit) { LinkedList ll = createGridlet( this.ID_.intValue() ); for(int k = 0; k < ll.size(); k++) { this.list_.addLast(ll.get(k)); } resubmit = false; } ---------------------- resubmit will be true initially, which will make "inkedList ll = createGridlet( this.ID_.intValue() );" create a new list of gridlets with the same ids of the gridlets that are already in list_. Regards, Marcos On 16/02/2009, at 7:40 PM, ye wrote: > <Example041.java> Marcos Dias de Assuncao Grid Computing and Distributed Systems (GRIDS) Laboratory Department of Computer Science and Software Engineering The University of Melbourne, Australia Email: ma...@cs... ------------- "It is well enough that people of the nation do not understand our banking and monetary system, for if they did, I believe there would be a revolution before tomorrow morning." Henry Ford |