|
From: <sul...@us...> - 2007-08-29 02:23:09
|
Revision: 42
http://gridsim.svn.sourceforge.net/gridsim/?rev=42&view=rev
Author: sulistio
Date: 2007-08-28 19:22:54 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
initial release. add a more complex example of resource failure. this code was done by Agustin and modified by me.
Modified Paths:
--------------
branches/gridsim4.0-branch1/examples/ResFailureEx01/README.txt
Added Paths:
-----------
branches/gridsim4.0-branch1/examples/ResFailureEx02/
branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Regional_GIS
branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_0
branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_1
branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_2
branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_3
branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_4
branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_5
branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_User_0
branches/gridsim4.0-branch1/examples/ResFailureEx02/GridUserFailureEx02.java
branches/gridsim4.0-branch1/examples/ResFailureEx02/GridletSubmission.java
branches/gridsim4.0-branch1/examples/ResFailureEx02/README.txt
branches/gridsim4.0-branch1/examples/ResFailureEx02/ResFailureEx02.java
branches/gridsim4.0-branch1/examples/ResFailureEx02/network_ex02.txt
branches/gridsim4.0-branch1/examples/ResFailureEx02/output.txt
Modified: branches/gridsim4.0-branch1/examples/ResFailureEx01/README.txt
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx01/README.txt 2007-08-29 02:16:53 UTC (rev 41)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx01/README.txt 2007-08-29 02:22:54 UTC (rev 42)
@@ -59,8 +59,7 @@
Ex01_User0 -> contains one line for each event regarding to the Gridlets.
These events are the sending/reception of a gridlet, and
- each line include the status of the gridlet,
- time, resource and VO. In this example we only have 1 VO.
+ each line include the status of the gridlet, time and resource.
Ex01_User0_Fin -> contains one line for each gridlet, showing the resource
it has been executed, its cost, CPU time and total latency.
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Regional_GIS
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Regional_GIS (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Regional_GIS 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,9 @@
+Event ResourceID Clock
+Registering 15 10.020000998399999
+Registering 20 10.030000998399998
+Registering 30 10.040000998399998
+Registering 25 10.050000998399998
+Registering 35 10.060000998399998
+Registering 10 10.070000998399998
+Removing 15 22.73144227840079
+Removing 10 289.4404053503977
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_0
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_0 (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_0 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,2 @@
+Event NumMachines Clock
+Failure 16 287.06017704959993
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_1
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_1 (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_1 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,2 @@
+Event NumMachines Clock
+Failure 16 22.031307878400685
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_2
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_2 (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_2 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,2 @@
+Event NumMachines Clock
+Failure 1 31.205426140020172
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_3
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_3 (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_3 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,2 @@
+Event NumMachines Clock
+Failure 3 30.27426340437428
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_4
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_4 (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_4 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,2 @@
+Event NumMachines Clock
+Failure 3 30.571085997276676
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_5
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_5 (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_Res_5 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,2 @@
+Event NumMachines Clock
+Failure 1 288.4904101503986
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_User_0
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_User_0 (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/Ex01_User_0 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,19 @@
+Event GridletID Resource GridletStatus Clock
+Sending 0 Ex01_Res_3 Created 289.0404101503981
+Sending 1 Ex01_Res_2 Created 289.9304101503973
+Sending 2 Ex01_Res_2 Created 290.8704101503964
+Sending 3 Ex01_Res_3 Created 291.72041015039565
+Sending 4 Ex01_Res_4 Created 292.5704101503949
+Receiving 1 Ex01_Res_2 Success 1159.070429350387
+Receiving 0 Ex01_Res_3 Success 1159.5404293503866
+Receiving 4 Ex01_Res_4 Success 1161.6004293503847
+Receiving 2 Ex01_Res_2 Success 1170.4804293503767
+Receiving 3 Ex01_Res_3 Success 1172.0604293503752
+
+
+GridletID Resource Cost CPU time Latency
+1 Ex01_Res_2 2572.0800000000017 857.3600000000006 566164.7597809572
+0 Ex01_Res_3 2572.830000000001 857.6100000000004 566164.7597809572
+4 Ex01_Res_4 2572.830000000001 857.6100000000004 566164.7597809572
+2 Ex01_Res_2 2571.6900000000023 857.2300000000007 566164.7597809572
+3 Ex01_Res_3 2572.830000000001 857.6100000000004 566164.7597809572
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/GridUserFailureEx02.java
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/GridUserFailureEx02.java (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/GridUserFailureEx02.java 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,749 @@
+/*
+ * Title: GridSim Toolkit
+ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation
+ * of Parallel and Distributed Systems such as Clusters and Grids
+ * An example of how to use the failure functionality.
+ * Licence: GPL - http://www.gnu.org/copyleft/gpl.html
+ *
+ * Author: Agustin Caminero and Anthony Sulistio
+ * Organization: UCLM (Spain)
+ * Created on: August 2007
+ */
+
+import gridsim.*;
+import gridsim.index.AbstractGIS;
+import gridsim.net.Link;
+import java.util.Random;
+import java.util.ArrayList;
+import java.io.FileWriter;
+import gridsim.resFailure.RegionalGISWithFailure;
+import eduni.simjava.Sim_system;
+import eduni.simjava.Sim_event;
+
+
+/**
+ * Creates a Grid User that also considers what happens if a resource fails.
+ * @author Agustin Caminero and Anthony Sulistio
+ * @since GridSim Toolkit 4.1
+ */
+public class GridUserFailureEx02 extends GridUser
+{
+ // the base for our constants (chosen at random)
+ private static final int BASE = 440000;
+
+ /** This constant is to tell the user when he should submit a gridlet */
+ private static final int SUBMIT_GRIDLET = BASE + 1;
+
+ private ArrayList GridletSubmittedList_; // list of submitted Gridlets
+ private GridletList GridletReceiveList_; // list of received Gridlets
+
+ private int NUM_GRIDLETS;
+ private double pollingTime_;
+
+ // The sizes of gridlets
+ private int gridletLength;
+ private int gridletInput;
+ private int gridletOutput;
+
+ // we keep here the time when each gridlet is submitted
+ private double gridletSubmissionTime [];
+ private double gridletLatencyTime [];
+
+ // a flag that denotes whether to trace GridSim events or not.
+ private boolean trace_flag;
+
+
+ /**
+ * Creates a GridUserFailure object
+ * @param name this entity name
+ * @param link a network link connecting this entity
+ * @param pollTime the time between polls
+ * @param glLength length (MI) for the gridlets of this user
+ * @param glIn input file size for the gridlets of this user
+ * @param glOut output file size for the gridlets of this user
+ * @param trace_flag a flag that denotes whether to trace this user events
+ * or not.
+ * @throws java.lang.Exception happens if either name or link is empty
+ */
+ public GridUserFailureEx02(String name, Link link, double pollTime,
+ int glLength, int glIn, int glOut, boolean trace_flag)
+ throws Exception
+ {
+ super(name, link);
+
+ this.GridletSubmittedList_ = new ArrayList();
+ this.GridletReceiveList_ = new GridletList();
+ pollingTime_ = pollTime;
+
+ gridletLength = glLength;
+ gridletInput = glIn;
+ gridletOutput = glOut;
+ this.trace_flag = trace_flag;
+ }
+
+ /**
+ * Sets the number of gridlets that this user has to submit.
+ * Also, create the submission and reception times arrays.
+ * @param gridlet_num the number of gridlets
+ */
+ public void setGridletNumber(int gridlet_num)
+ {
+ NUM_GRIDLETS = gridlet_num;
+
+ gridletSubmissionTime = new double[NUM_GRIDLETS];
+ gridletLatencyTime = new double[NUM_GRIDLETS];
+ }
+
+ /**
+ * Handles incoming requests to this entity.
+ * This method specifies the behaviours and/or scenarios of a user.
+ */
+ public void body()
+ {
+ initializeResultsFile();
+ createGridlet(super.get_id(), NUM_GRIDLETS);
+
+ // schedule the initial sending of gridlets.
+ // The sending will start in a ramdom time within 5 min
+ Random random = new Random();
+ int init_time = random.nextInt(5*60);
+
+ // sends a reminder to itself
+ super.send(super.get_id(), init_time, SUBMIT_GRIDLET);
+ System.out.println(super.get_name() +
+ ": initial SUBMIT_GRIDLET event will be at clock: " +
+ init_time + ". Current clock: " + GridSim.clock());
+
+
+ ////////////////////////////////////////////////////////////
+ // Now, we have the framework of the entity:
+ while (Sim_system.running())
+ {
+ Sim_event ev = new Sim_event();
+ super.sim_get_next(ev); // get the next event in the queue
+
+ switch (ev.get_tag())
+ {
+ // submit a gridlet
+ case SUBMIT_GRIDLET:
+ processGridletSubmission(ev); // process the received event
+ break;
+
+ // Receive a gridlet back
+ case GridSimTags.GRIDLET_RETURN:
+ processGridletReturn(ev);
+ break;
+
+ case GridSimTags.END_OF_SIMULATION:
+ System.out.println("\n============== " + super.get_name() +
+ ". Ending simulation...");
+ break;
+
+ default:
+ System.out.println(super.get_name() +
+ ": Received an event: " + ev.get_tag());
+ break;
+
+ } // switch
+
+ } // while
+
+ // wait for few seconds before printing the output
+ super.sim_pause( super.get_id()*2 );
+
+ // remove I/O entities created during construction of this entity
+ super.terminateIOEntities();
+
+ // prints the completed gridlets
+ printGridletList(GridletReceiveList_, super.get_name(), false,
+ gridletLatencyTime);
+ } // body()
+
+ /////////////////////////////////////////////////////////////////////////
+
+ /**
+ * This functions process the submission of a gridlet. We have to get the
+ * list of available resources from the RegGIS, choose one of them, and
+ * submit the gridlet.
+ * @param ev an incoming event
+ */
+ private void processGridletSubmission(Sim_event ev)
+ {
+ if (trace_flag)
+ {
+ System.out.println(super.get_name() +
+ ": received an SUBMIT_GRIDLET event. Clock: " + GridSim.clock());
+ }
+
+ /***********
+ We have to submit:
+ - the gridlet whose id comes with the event
+ - all the gridlets with the "gridletSub.getSubmitted() == false"
+
+ So, set the gridletSub.getSubmitted() to false for the gridlet whose
+ id comes with the event
+ ***********/
+
+ int i = 0;
+ GridletSubmission gridletSub;
+ int resourceID[];
+ Random random = new Random(5); // a random generator with a random seed
+ int index;
+ Gridlet gl;
+ Integer obj;
+ int glID;
+
+ // This is because the initial GRIDLET_SUBMIT event, at the beginning
+ // of sims, does not have any gridlet id. We have to submit
+ // all the gridlets.
+ if (ev.get_data() instanceof Integer)
+ {
+ obj = (Integer) ev.get_data();
+ glID = obj.intValue(); // get the gridlet id.
+ }
+ else {
+ glID = 99; // a value at random, not used at all in this case
+ }
+
+ while (i < GridletSubmittedList_.size())
+ {
+ gridletSub = (GridletSubmission)GridletSubmittedList_.get(i);
+
+ if ( (gridletSub.getGridlet()).getGridletID() == glID )
+ {
+ // set this gridlet whose id comes with the event as not submitted,
+ // so that it is submitted as soon as possible.
+ ((GridletSubmission) GridletSubmittedList_.get(i)).setSubmitted(false);
+ }
+
+ // Submit the gridlets with the "gridletSub.getSubmitted() == false"
+ if ( (gridletSub.getSubmitted() == false))
+ {
+ // we have to resubmit this gridlet
+ gl = ((GridletSubmission) GridletSubmittedList_.get(i)).getGridlet();
+ resourceID = getResList(); // Get list of resources from GIS
+
+ // If we have resources in the list
+ if ((resourceID != null) && (resourceID.length != 0))
+ {
+ index = random.nextInt(resourceID.length);
+
+ // make sure the gridlet will be executed from the begining
+ resetGridlet(gl);
+
+ // submits this gridlet to a resource
+ super.gridletSubmit(gl, resourceID[index]);
+ gridletSubmissionTime[gl.getGridletID()] = GridSim.clock();
+
+ // set this gridlet as submitted
+ ((GridletSubmission) GridletSubmittedList_.get(i)).setSubmitted(true);
+
+ if (trace_flag)
+ {
+ System.out.println(super.get_name() +
+ ": Sending Gridlet #" + i + " to " +
+ GridSim.getEntityName(resourceID[index]) +
+ " at clock: " + GridSim.clock());
+
+ // Write into a results file
+ write(super.get_name(), "Sending", gl.getGridletID(),
+ GridSim.getEntityName(resourceID[index]),
+ gl.getGridletStatusString(), GridSim.clock());
+ }
+
+ }
+ // No resources available at this moment, so schedule an event
+ // in the future. The event wil be in 15 min (900 sec), as
+ // resource failures may last several hours.
+ // This event includes the gridletID, so that the user will
+ // try to submit only this gridlet
+ else
+ {
+ super.send(super.get_id(), GridSimTags.SCHEDULE_NOW + 900,
+ SUBMIT_GRIDLET, new Integer(gl.getGridletID()) );
+ }
+
+ }// if (gridletSub.getSubmitted() == false)
+
+ i++;
+ } // while (i < GridletSubmittedList_.size())
+
+ } // processGridletSubmission
+
+ /**
+ * This functions process the return of a gridlet.
+ * We pay attention to the status of the gridlet
+ * and then decide what we have to do the next
+ * @param ev an incoming event
+ */
+ private void processGridletReturn(Sim_event ev)
+ {
+ if (trace_flag)
+ {
+ System.out.println(super.get_name() +
+ ": received an GRIDLET_RETURN event. Clock: " + GridSim.clock());
+ }
+
+ Object obj = (Object) ev.get_data();
+ Gridlet gl = null;
+ Random random = new Random(5); // a random generator with a random seed
+
+ if (obj instanceof Gridlet)
+ {
+ gl = (Gridlet) obj;
+ gridletLatencyTime[gl.getGridletID()] = GridSim.clock();
+
+ // Write into a results file
+ if (trace_flag)
+ {
+ write(super.get_name(), "Receiving", gl.getGridletID(),
+ GridSim.getEntityName(gl.getResourceID()),
+ gl.getGridletStatusString(), GridSim.clock());
+ }
+
+ ///////////////////////// Gridlet Success
+ if (gl.getGridletStatusString().compareTo("Success") == 0)
+ {
+ System.out.println(super.get_name() + ": Receiving Gridlet #" +
+ gl.getGridletID() + " with status Success at time = " +
+ GridSim.clock() + " from resource " +
+ GridSim.getEntityName(gl.getResourceID()));
+
+ this.GridletReceiveList_.add(gl); // add into the received list
+ gridletLatencyTime[gl.getGridletID()] =
+ gridletLatencyTime[gl.getGridletID()] -
+ gridletSubmissionTime[gl.getGridletID()];
+
+ // We have received all the gridlets. So, finish the simulation.
+ if (GridletReceiveList_.size() == GridletSubmittedList_.size())
+ {
+ super.finishSimulation();
+ }
+
+ } // if (gl.getGridletStatusString() == "Success")
+
+ //////////////////////// Gridlet Failed
+ else if (gl.getGridletStatusString().compareTo("Failed") == 0)
+ {
+ System.out.println(super.get_name() + ": Receiving Gridlet #" +
+ gl.getGridletID() + " with status Failed at time = " +
+ GridSim.clock() + " from resource " +
+ GridSim.getEntityName(gl.getResourceID()));
+
+ // Send the gridlet as soon as we have resources available.
+ // This gridlet will be resend as soon as possible,
+ // in the first loop.
+ int pos = findGridletInGridletSubmittedList(gl);
+ if (pos == -1) {
+ System.out.println(super.get_name() +
+ ". Gridlet not found in GridletSubmittedList.");
+ }
+ else
+ {
+ // set this gridlet as submitted, because otherwise
+ // this gridlet may be submitted several times.
+ // A gridlet will only be submitted when the event carrying
+ // its id reaches the user
+ ((GridletSubmission) GridletSubmittedList_.get(pos)).setSubmitted(true);
+
+ // Now, schedule an event to itself to submit the gridlet
+ // The gridlet will be sent as soon as possible
+ Integer glID_Int = new Integer(gl.getGridletID());
+
+ // This event includes the gridletID, so that the user
+ // will try to submit only this gridlet
+ super.send(super.get_id(), GridSimTags.SCHEDULE_NOW,
+ SUBMIT_GRIDLET, glID_Int);
+ }
+ } // if (gl.getGridletStatusString() == "Failed")
+
+ ////////////////////////////// Gridlet Failed_resource
+ else if (gl.getGridletStatusString().compareTo("Failed_resource_unavailable") == 0)
+ {
+ int pos = findGridletInGridletSubmittedList(gl);
+ if (pos == -1) {
+ System.out.println(super.get_name() +
+ ". Gridlet not found in GridletSubmittedList.");
+ }
+ else
+ {
+ // Now, set its submission time for a random time between
+ // 1 and the polling time
+ double resubmissionTime = random.nextDouble() * pollingTime_;
+
+ // this is to prevent the gridlet from being submitted
+ // before its resubmission time.
+ // This is different from the FAILED case, because
+ // in that case, the gridlet should be resubmited as soon
+ // as possible. As oppossed to that, this gridlet should
+ // not be resubmited before its resubmission time.
+ ((GridletSubmission) GridletSubmittedList_.get(pos)).setSubmitted(true);
+
+
+ System.out.println(super.get_name() + ": Receiving Gridlet #" +
+ gl.getGridletID() +
+ " with status Failed_resource_unavailable at time = " +
+ GridSim.clock() + " from resource " +
+ GridSim.getEntityName(gl.getResourceID()) +
+ "(resID: " + gl.getResourceID() +
+ "). Resubmission time will be: " +
+ resubmissionTime + GridSim.clock());
+
+ // Now, we have to inform the GIS about this failure, so it
+ // can keep the list of resources up-to-date.
+ informGIS(gl.getResourceID());
+
+ // Now, schedule an event to itself to submit the gridlet
+ Integer glID_Int = new Integer(gl.getGridletID());
+
+ // This event includes the gridletID, so that the user
+ // will try to submit only this gridlet
+ super.send(super.get_id(), resubmissionTime,
+ SUBMIT_GRIDLET, glID_Int);
+ }
+ } // else if
+ else
+ {
+ System.out.println(super.get_name() + ": Receiving Gridlet #" +
+ gl.getGridletID() + " with status " +
+ gl.getGridletStatusString() + " at time = " +
+ GridSim.clock() + " from resource " +
+ GridSim.getEntityName(gl.getResourceID()) +
+ " resID: " + gl.getResourceID());
+ }
+
+ } // if (obj instanceof Gridlet)
+ }
+
+ /**
+ * Prints the Gridlet objects
+ * @param list the list of gridlets
+ * @param name the name of the user
+ * @param detail if we want the gridlet's history or not
+ * @param gridletLatencyTime array containing the latencies of gridlets.
+ * Latencies are from the moment when the gridlet is sent, till
+ * the moment they are back at the user.
+ * They take into account the last submission of a gridlet
+ * (when the gridlet is successfully run)
+ */
+ private void printGridletList(GridletList list, String name,
+ boolean detail, double gridletLatencyTime[])
+ {
+ int size = list.size();
+ Gridlet gridlet = null;
+
+ String indent = " ";
+ StringBuffer buffer = new StringBuffer(1000);
+ buffer.append("\n\n============== OUTPUT for " + name + " ===========");
+ buffer.append("\nGridlet ID" + indent + "STATUS" + indent +
+ "Resource ID" + indent + indent + "Cost" + indent +
+ indent + "CPU Time" + indent + indent + "Latency");
+
+ // a loop to print the overall result
+ int i = 0;
+ boolean header = true;
+
+ for (i = 0; i < size; i++)
+ {
+ gridlet = (Gridlet) list.get(i);
+
+ buffer.append("\n");
+ buffer.append(indent + gridlet.getGridletID() + indent + indent);
+ buffer.append( gridlet.getGridletStatusString() );
+ buffer.append(indent + indent + gridlet.getResourceID() +
+ indent + gridlet.getProcessingCost() +
+ indent + gridlet.getActualCPUTime() +
+ indent + gridletLatencyTime[gridlet.getGridletID()]);
+
+ if (i != 0) {
+ header = false;
+ }
+
+ writeFin(name, gridlet.getGridletID(),
+ GridSim.getEntityName(gridlet.getResourceID()),
+ gridlet.getProcessingCost(), gridlet.getActualCPUTime(),
+ GridSim.clock(), header);
+ }
+
+ if (detail == true)
+ {
+ // a loop to print each Gridlet's history
+ for (i = 0; i < size; i++)
+ {
+ gridlet = (Gridlet) list.get(i);
+
+ buffer.append( gridlet.getGridletHistory() );
+ buffer.append("Gridlet #" + gridlet.getGridletID());
+ buffer.append(", length = " + gridlet.getGridletLength()
+ + ", finished so far = " +
+ gridlet.getGridletFinishedSoFar());
+ buffer.append("===========================================");
+ }
+ }
+
+ buffer.append("\n====================================================");
+ System.out.println( buffer.toString() );
+
+ }
+
+ /**
+ * This method will show you on how to create Gridlets
+ * @param userID owner ID of a Gridlet
+ * @param numGridlet number of Gridlet to be created
+ */
+ private void createGridlet(int userID, int numGridlet)
+ {
+ for (int i = 0; i < numGridlet; i++)
+ {
+ // Creates a Gridlet
+ Gridlet gl = new Gridlet(i, gridletLength, gridletInput, gridletOutput);
+ gl.setUserID(userID);
+
+ // Originally, gridlets are created to be submitted
+ // as soon as possible (the 0.0 param)
+ GridletSubmission gst = new GridletSubmission(gl, false);
+
+ // add this gridlet into a list
+ this.GridletSubmittedList_.add(gst);
+ }
+ }
+
+ /**
+ * Gets a list of received Gridlets
+ * @return a list of received/completed Gridlets
+ */
+ public GridletList getGridletList() {
+ return GridletReceiveList_;
+ }
+
+ /**
+ * Tells you the possition of this gridlet in the GridletSubmittedList_
+ * @param gl the gridlet
+ * @return the position of this gridlet in the list of submitted gridlets
+ */
+ private int findGridletInGridletSubmittedList(Gridlet gl)
+ {
+ Gridlet g = null;
+ GridletSubmission gst = null;
+ for (int i = 0; i< GridletSubmittedList_.size(); i++)
+ {
+ gst = (GridletSubmission)GridletSubmittedList_.get(i);
+ g = gst.getGridlet();
+
+ if ( g.getGridletID() == gl.getGridletID() )
+ return i;
+ }
+
+ return -1;
+ }
+
+ /** This function resets the gridlet into its original values of
+ * length and gridletFinishedSoFar
+ * @param gl the gridlet to be resetted
+ */
+ private void resetGridlet (Gridlet gl)
+ {
+ gl.setGridletLength(gridletLength);
+ gl.setGridletFinishedSoFar(0);
+
+ }
+
+ /**
+ * Write some data into the final results file.
+ * @param user user name
+ * @param glID gridlet id
+ * @param resName Name of the resource
+ * @param cost the processing cost of the gridlet
+ * @param cpu the cpu time
+ * @param clock Current time
+ * @param header write a row header or not
+ * */
+ private void writeFin(String user, int glID, String resName,
+ double cost, double cpu, double clock,
+ boolean header)
+ {
+ if (trace_flag == false) {
+ return;
+ }
+
+ // Write into a results file
+ FileWriter fwriter = null;
+ try
+ {
+ fwriter = new FileWriter(user, true);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while opening file " + user);
+ }
+
+ try
+ {
+ if (header == true) {
+ fwriter.write(
+ "\n\nGridletID \t Resource \t Cost \t CPU time \t Latency\n");
+ }
+
+ fwriter.write(glID + "\t" + resName + "\t" + cost + "\t"+ cpu +
+ "\t" + + clock + "\n");
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while writing on file " + user);
+ }
+
+ try
+ {
+ fwriter.close();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while closing file " + user);
+ }
+
+ }
+
+ /**
+ * Write some data into a results file.
+ * @param user user name
+ * @param event Values: "Sending" or "Receive" a gridlet
+ * @param glID gridlet id
+ * @param resName Name of the resource
+ * @param status Status of the gridlet
+ * @param clock Current time
+ */
+ private void write(String user, String event, int glID, String resName,
+ String status, double clock)
+ {
+ if (trace_flag == false) {
+ return;
+ }
+
+ // Write into a results file
+ FileWriter fwriter = null;
+ try
+ {
+ fwriter = new FileWriter(super.get_name(), true);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while opening file " + super.get_name());
+ }
+
+ try
+ {
+ fwriter.write(event + "\t\t" + glID + "\t" + resName + "\t" + status +
+ "\t\t" + clock + "\n");
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while writing on file " + super.get_name());
+ }
+
+
+ try
+ {
+ fwriter.close();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while closing file " + super.get_name());
+ }
+
+ }
+
+ /**
+ * This function informs the GIS of this user about the failure of a resource
+ * @param resID the id of the resource which has failed
+ */
+ private void informGIS(int resID)
+ {
+ Integer resID_Int = new Integer(resID);
+
+ super.send(super.output, 0.0, AbstractGIS.NOTIFY_GIS_RESOURCE_FAILURE,
+ new IO_data(resID_Int, Link.DEFAULT_MTU, super.getRegionalGISId()) );
+ }
+
+ /**
+ * Initialize the results files (put headers over each column)
+ * */
+ private void initializeResultsFile()
+ {
+ if (trace_flag == false) {
+ return;
+ }
+
+ // Initialize the results file
+ FileWriter fwriter = null;
+ try
+ {
+ fwriter = new FileWriter(super.get_name(), true);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while opening file " + super.get_name() +
+ " or " + super.get_name()+"_Fin");
+ }
+
+ try
+ {
+ fwriter.write(
+ "Event \t GridletID \t Resource \t GridletStatus \t\t Clock\n");
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while writing on file " + super.get_name()+
+ " or " + super.get_name()+"_Fin");
+ }
+
+ try
+ {
+ fwriter.close();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ System.out.println(
+ "Unwanted errors while closing file " + super.get_name()+
+ " or " + super.get_name()+"_Fin");
+ }
+ }
+
+ /**
+ * This function retrieves a list of available resources from the GIS.
+ * @return an array containing the ids of the resources
+ */
+ private int[] getResList()
+ {
+ Object[] resList = super.getLocalResourceList();
+ int resourceID[] = null;
+
+ // if we have any resource
+ if ((resList != null) && (resList.length != 0))
+ {
+ resourceID = new int[resList.length];
+ for (int x = 0; x < resList.length; x++)
+ {
+ // Resource list contains list of resource IDs
+ resourceID[x] = ((Integer) resList[x]).intValue();
+
+ if (trace_flag == true)
+ {
+ System.out.println(super.get_name() +
+ ": resource[" + x + "] = " + resourceID[x]);
+ }
+ }
+
+ }
+
+ return resourceID;
+ }
+
+} // end class
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/GridletSubmission.java
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/GridletSubmission.java (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/GridletSubmission.java 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,54 @@
+/*
+ * Title: GridSim Toolkit
+ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation
+ * of Parallel and Distributed Systems such as Clusters and Grids
+ * An example of how to use the failure functionality.
+ * Licence: GPL - http://www.gnu.org/copyleft/gpl.html
+ *
+ * Author: Agustin Caminero and Anthony Sulistio
+ * Organization: UCLM (Spain)
+ * Created on: August 2007
+ */
+
+
+import gridsim.Gridlet;
+
+/**
+ * This class is just a wrapper to denote
+ * whether this gridlet has been already submitted or not
+ * @author Agustin Caminero and Anthony Sulistio
+ * @since GridSim Toolkit 4.1
+ */
+public class GridletSubmission
+{
+ private Gridlet gl;
+ private boolean submitted;
+
+
+ public GridletSubmission(Gridlet gl,boolean submitted)
+ {
+ this.gl = gl;
+ this.submitted = submitted;
+ }
+
+ public Gridlet getGridlet()
+ {
+ return gl;
+ }
+
+ public boolean getSubmitted()
+ {
+ return submitted;
+ }
+
+ public void setGridlet(Gridlet g)
+ {
+ this.gl = g;
+ }
+
+ public void setSubmitted(boolean submitted)
+ {
+ this.submitted = submitted;
+ }
+
+} // end class
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/README.txt
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/README.txt (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/README.txt 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,67 @@
+/*
+ * Title: GridSim Toolkit
+ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation
+ * of Parallel and Distributed Systems such as Clusters and Grids
+ * An example of how to use the failure functionality.
+ * Licence: GPL - http://www.gnu.org/copyleft/gpl.html
+ *
+ * Author: Agustin Caminero and Anthony Sulistio
+ * Organization: UCLM (Spain)
+ * Created on: August 2007
+ */
+
+Welcome to the example of how to use the computing resource failure functionality
+To compile the example source code:
+ In Unix/Linux: javac -classpath $GRIDSIM/jars/gridsim.jar:. ResFailureEx01.java
+ In Windows: javac -classpath %GRIDSIM%\jars\gridsim.jar;. ResFailureEx01.java
+
+where $GRIDSIM or %GRIDSIM% is the location of the gridsimtoolkit package.
+
+
+To run the class file:
+In Unix/Linux:
+ java -classpath $GRIDSIM/jars/gridsim.jar:. ResFailureEx02 network_ex02.txt > file.txt
+
+In Windows:
+ java -classpath %GRIDSIM%\jars\gridsim.jar;. ResFailureEx02 network_ex02.txt > file.txt
+
+
+The above command means run the program and output the results into a file
+named "file.txt" rather than into screen or standard output.
+To prevent from overwriting an existing file,
+I renamed "file.txt" into "output.txt"
+
+NOTE: This example uses probabilistic distributions and random variables.
+ Hence, when running this example many times, the values will be different.
+
+
+When running the example file, it will produce the following files:
+
+ sim_trace -> created by the SimJava2 package (lower-level) to trace every
+ events (performed by SimJava and GridSim) during the simulation.
+ We don't need to worry about this file. Not to important for our
+ example.
+
+ sim_report -> created by the SimJava2 package (lower-level) of GridSim.
+ This is a simulation report that contains general information about
+ running this experiment. We don't need to worry about this file.
+ Not to important for our example.
+
+ Ex02_Regional_GIS -> contains one line describing each
+ registering/removing an event that takes place at the GIS. Resources
+ register in the begining of simulations, and after recovering from a
+ failure affecting all their machines. Resources will be removed when
+ they suffer a failure affecting all their machines.
+
+ Ex02_Res_0, ... , Ex01_Res_5 -> records when the resource
+ suffers a failure and when it recovers from the failure. It also records
+ how many machines failed, and the time of the fail/recovery.
+
+ Ex02_User_0 -> contains one line for each event regarding to the Gridlets.
+ These events are the sending/reception of a gridlet, and
+ each line include the status of the gridlet, time and resource.
+ Then, when a simulation ends, this file shows the resource
+ a Gridlet has been executed, its cost, CPU time and total latency.
+
+NOTE: When you run the program multiple times, the new statistics will be
+ appended at the end of a file.
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/ResFailureEx02.java
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/ResFailureEx02.java (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/ResFailureEx02.java 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,334 @@
+/*
+ * Title: GridSim Toolkit
+ * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation
+ * of Parallel and Distributed Systems such as Clusters and Grids
+ * An example of how to use the failure functionality.
+ * Licence: GPL - http://www.gnu.org/copyleft/gpl.html
+ *
+ * Author: Agustin Caminero and Anthony Sulistio
+ * Organization: UCLM (Spain)
+ * Created on: August 2007
+ */
+
+import gridsim.resFailure.*;
+import gridsim.*;
+import gridsim.net.*;
+import java.util.*;
+import gridsim.util.NetworkReader;
+import gridsim.util.HyperExponential;
+
+
+/**
+ * This example shows a basic topology with 1 user, 3 resources and 1 GIS.
+ * All of them are connected by a router.
+ * There is only one VO in this example.
+ * @author Agustin Caminero and Anthony Sulistio
+ * @since GridSim Toolkit 4.1
+ */
+public class ResFailureEx02
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Starting failure example 2...");
+
+ try
+ {
+ if (args.length < 1)
+ {
+ System.out.println("Usage: java ResFailureEx02 network_ex02.txt");
+ return;
+ }
+
+
+ //////////////////////////////////////////
+ // First step: Initialize the GridSim package. It should be called
+ // before creating any entities. We can't run this example without
+ // initializing GridSim first. We will get a run-time exception
+ // error.
+
+ // a flag that denotes whether to trace GridSim events or not.
+ boolean trace_flag = false; // dont use SimJava trace
+ int num_user = 20; // number of grid users
+ Calendar calendar = Calendar.getInstance();
+
+ // Initialize the GridSim package
+ System.out.println("Initializing GridSim package");
+ GridSim.init(num_user, calendar, trace_flag);
+ trace_flag = true;
+
+
+ //////////////////////////////////////////
+ // Second step: Builds the network topology among Routers.
+
+ String filename = args[0]; // get the network topology
+ System.out.println("Reading network from " + filename);
+ LinkedList routerList = NetworkReader.createFIFO(filename);
+
+
+ //////////////////////////////////////////
+ // Third step: Creates one RegionalGISWithFailure entity,
+ // linked to a router in the topology
+
+ Router router = null;
+ double baud_rate = 100000000; // 100Mbps, i.e. baud rate of links
+ double propDelay = 10; // propagation delay in milliseconds
+ int mtu = 1500; // max. transmission unit in byte
+ int totalMachines = 16; // num of machines each resource has
+
+ String NAME = "Ex01_"; // a common name
+ String gisName = NAME + "Regional_GIS"; // GIS name
+
+ // a network link attached to this regional GIS entity
+ Link link = new SimpleLink(gisName + "_link", baud_rate,
+ propDelay, mtu);
+
+
+ // HyperExponential: mean, standard deviation, stream
+ // how many resources will fail
+ HyperExponential failureNumResPattern =
+ new HyperExponential(totalMachines / 2, totalMachines, 4);
+
+ // when they will fail
+ HyperExponential failureTimePattern =
+ new HyperExponential(25, 100, 4);
+
+ // how long the failure will be
+ HyperExponential failureLengthPattern =
+ new HyperExponential(20, 25, 4); // big test: (20, 100, 4);
+
+
+ // creates a new Regional GIS entity that generates a resource
+ // failure message according to these patterns.
+ RegionalGISWithFailure gis = new RegionalGISWithFailure(gisName,
+ link, failureNumResPattern, failureTimePattern,
+ failureLengthPattern);
+ gis.setTrace(trace_flag); // record this GIS activity
+
+ // link these GIS to a router
+ router = NetworkReader.getRouter("Router0", routerList);
+ linkNetwork(router, gis);
+
+ // print some info messages
+ System.out.println("Created a REGIONAL GIS with name " + gisName +
+ " and id = " + gis.get_id() + ", connected to " +
+ router.get_name() );
+
+
+ //////////////////////////////////////////
+ // Fourth step: Creates one or more GridResourceWithFailure
+ // entities, linked to a router in the topology
+
+ String sched_alg = "SPACE"; // use space-shared policy
+ int totalResource = 6; // number of resources
+ ArrayList resList = new ArrayList(totalResource);
+
+ // Each resource may have different baud rate,
+ // totalMachine, rating, allocation policy and the router to
+ // which it will be connected. However, in this example, we assume
+ // all have the same properties for simplicity.
+ int totalPE = 4; // num of PEs each machine has
+ int rating = 49000; // rating (MIPS) of PEs
+ int GB = 1000000000; // 1 GB in bits
+ baud_rate = 2.5 * GB;
+
+ for (int i = 0; i < totalResource; i++)
+ {
+ // gets the router object from the list
+ router = NetworkReader.getRouter("Router0", routerList);
+
+ // creates a new grid resource
+ String resName = NAME + "Res_" + i;
+ GridResourceWithFailure res = createGridResource(resName,
+ baud_rate, propDelay, mtu, totalPE, totalMachines,
+ rating, sched_alg);
+
+ // add a resource into a list
+ resList.add(res);
+ res.setRegionalGIS(gis); // set the regional GIS entity
+ res.setTrace(trace_flag); // record this resource activity
+
+ // link a resource to this router object
+ linkNetwork(router, res);
+
+ System.out.println("Created a RESOURCE (" + totalMachines +
+ " machines, each with " + totalPE + " PEs) with name = " +
+ resName + " and id = " + res.get_id() +
+ ", connected to router " + router.get_name() +
+ " and registered to " + gis.get_name() );
+ }
+
+
+ //////////////////////////////////////////
+ // Fifth step: Creates one or more GridUserFailure entities,
+ // linked to a router of the topology
+
+ int totalGridlet = 5; // total jobs
+ double pollTime = 100; // time between polls
+ int glSize = 100000; // the size of gridlets (input/output)
+ int glLength = 42000000; // the length (MI) of gridlets
+
+ // gets the router object from the list
+ router = NetworkReader.getRouter("Router0", routerList);
+
+ for (int i = 0; i < num_user; i++)
+ {
+ String userName = NAME + "User_" + i;
+
+ // a network link attached to this entity
+ Link link2 = new SimpleLink(userName + "_link", baud_rate,
+ propDelay, mtu);
+
+ // only keeps track activities from User_0
+ if (i != 0) {
+ trace_flag = false;
+ }
+
+ GridUserFailureEx02 user = new GridUserFailureEx02(userName, link2,
+ pollTime, glLength, glSize, glSize, trace_flag);
+
+ user.setRegionalGIS(gis); // set the regional GIS entity
+ user.setGridletNumber(totalGridlet);
+
+ // link a resource to this router object
+ linkNetwork(router, user);
+
+ System.out.println("Created a USER with name " + userName +
+ " and id = " + user.get_id() + ", connected to " +
+ router.get_name() + ", and with " + totalGridlet +
+ " gridlets. Registered to " + gis.get_name() );
+ }
+ System.out.println();
+
+ //////////////////////////////////////////
+ // Sixth step: Starts the simulation
+ GridSim.startGridSimulation();
+ System.out.println("\nFinish failure example 2... \n");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.out.println("Unwanted errors happen");
+ }
+ }
+
+ /**
+ * Links a particular entity with a given Router.
+ *
+ * @param router a Router object
+ * @param obj a GridSim entity to be attached to the Router
+ */
+ private static void linkNetwork(Router router, GridSimCore obj) throws Exception
+ {
+ if (router == null) {
+ System.out.println("Error - router is NULL.");
+ return;
+ }
+
+ // get the baud rate of a link
+ double baud_rate = obj.getLink().getBaudRate();
+
+ // create the packet scheduler for this link
+ PacketScheduler pktObj = new FIFOScheduler(router.get_name() +
+ "_to_" + obj.get_name() );
+
+ // attach this GridSim entity to a Router
+ router.attachHost(obj, pktObj);
+ }
+
+ /**
+ * Creates one Grid resource. A Grid resource contains one or more
+ * Machines. Similarly, a Machine contains one or more PEs (Processing
+ * Elements or CPUs).
+ * <p>
+ * In this simple example, we are simulating one Grid resource with three
+ * Machines that contains one or more PEs.
+ *
+ * @param name a Grid Resource name
+ * @param baud_rate the bandwidth of this entity
+ * @param delay the propagation delay
+ * @param MTU Maximum Transmission Unit
+ * @param totalPE number of PE per machine
+ * @param totalMachine number of machines in this resources
+ * @param rating rating of mahcines in this resource
+ * @param sched_alg the scheduling algorithm of this resource
+ * @return a GridResource object
+ */
+ private static GridResourceWithFailure createGridResource(String name,
+ double baud_rate, double delay, int MTU, int totalPE,
+ int totalMachine, int rating, String sched_alg)
+ {
+ // Here are the steps needed to create a Grid resource:
+ // 1. We need to create an object of MachineList to store one or more
+ // Machines
+ MachineList mList = new MachineList();
+ for (int i = 0; i < totalMachine; i++)
+ {
+ // 2. A Machine contains one or more PEs or CPUs. Therefore, should
+ // create an object of PEList to store these PEs before creating
+ // a Machine.
+ PEList peList = new PEList();
+
+ // 3. Create PEs and add these into an object of PEList.
+ for (int k = 0; k < totalPE; k++)
+ {
+ // need to store PE id and MIPS Rating
+ peList.add( new PE(k, rating) );
+ }
+
+ // 4. Create one Machine with its id and list of PEs or CPUs
+ mList.add( new Machine(i, peList) );
+ }
+
+
+ // 5. Create a ResourceCharacteristics object that stores the
+ // properties of a Grid resource: architecture, OS, list of
+ // Machines, allocation policy: time- or space-shared, time zone
+ // and its price (G$/PE time unit).
+ String arch = "Sun Ultra"; // system architecture
+ String os = "Solaris"; // operating system
+ double time_zone = 9.0; // time zone this resource located
+ double cost = 3.0; // the cost of using this resource
+
+ // we create Space_Shared_failure or Time_Shared_failure schedulers
+ int scheduling_alg = 0; // space_shared or time_shared
+ if (sched_alg.equals("SPACE") == true) {
+ scheduling_alg = ResourceCharacteristics.SPACE_SHARED;
+ }
+ else if (sched_alg.equals("TIME") == true) {
+ scheduling_alg = ResourceCharacteristics.TIME_SHARED;
+ }
+
+ ResourceCharacteristics resConfig = new ResourceCharacteristics(
+ arch, os, mList, scheduling_alg, time_zone, cost);
+
+
+ // 6. Finally, we need to create a GridResource object.
+ long seed = 11L*13*17*19*23+1;
+ double peakLoad = 0.0; // the resource load during peak hour
+ double offPeakLoad = 0.0; // the resource load during off-peak hr
+ double holidayLoad = 0.0; // the resource load during holiday
+
+ // incorporates weekends so the grid resource is on 7 days a week
+ LinkedList Weekends = new LinkedList();
+ Weekends.add(new Integer(Calendar.SATURDAY));
+ Weekends.add(new Integer(Calendar.SUNDAY));
+
+ // incorporates holidays. However, no holidays are set in this example
+ LinkedList Holidays = new LinkedList();
+ GridResourceWithFailure gridRes = null;
+ try
+ {
+ // creates a GridResource with a link
+ gridRes = new GridResourceWithFailure(name,
+ new SimpleLink(name + "_link", baud_rate, delay, MTU),
+ seed, resConfig, peakLoad, offPeakLoad, holidayLoad,
+ Weekends, Holidays);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return gridRes;
+ }
+
+} // end class
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/network_ex02.txt
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/network_ex02.txt (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/network_ex02.txt 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,15 @@
+# The topology of this example is as follows (with 20 users and 6 resources)
+#
+# user --- Router0 ---- Resource0
+#
+# total number of Routers
+1
+
+# specifies each router name and whether to log its activities or not
+# by default no logging is required
+Router0
+
+# specify the link between two Routers
+# The format is:
+# Router_name1 Router_name2 baud_rate(GB/s) prop_delay(ms) mtu(byte)
+
Added: branches/gridsim4.0-branch1/examples/ResFailureEx02/output.txt
===================================================================
--- branches/gridsim4.0-branch1/examples/ResFailureEx02/output.txt (rev 0)
+++ branches/gridsim4.0-branch1/examples/ResFailureEx02/output.txt 2007-08-29 02:22:54 UTC (rev 42)
@@ -0,0 +1,628 @@
+Starting failure example 2...
+Initializing GridSim package
+Initialising...
+Reading network from network_ex02.txt
+Created a REGIONAL GIS with name Ex01_Regional_GIS and id = 6, connected to Router0
+Created a RESOURCE (16 machines, each with 4 PEs) with name = Ex01_Res_0 and id = 10, connected to router Router0 and registered to Ex01_Regional_GIS
+Created a RESOURCE (16 machines, each with 4 PEs) with name = Ex01_Res_1 and id = 15, connected to router Router0 and registered to Ex01_Regional_GIS
+Created a RESOURCE (16 machines, each with 4 PEs) with name = Ex01_Res_2 and id = 20, connected to router Router0 and registered to Ex01_Regional_GIS
+Created a RESOURCE (16 machines, each with 4 PEs) with name = Ex01_Res_3 and id = 25, connected to router Router0 and registered to Ex01_Regional_GIS
+Created a RESOURCE (16 machines, each with 4 PEs) with name = Ex01_Res_4 and id = 30, connected to router Router0 and registered to Ex01_Regional_GIS
+Created a RESOURCE (16 machines, each with 4 PEs) with name = Ex01_Res_5 and id = 35, connected to router Router0 and registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_0 and id = 40, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_1 and id = 44, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_2 and id = 48, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_3 and id = 52, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_4 and id = 56, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_5 and id = 60, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_6 and id = 64, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_7 and id = 68, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_8 and id = 72, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_9 and id = 76, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_10 and id = 80, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_11 and id = 84, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_12 and id = 88, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_13 and id = 92, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_14 and id = 96, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_15 and id = 100, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_16 and id = 104, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_17 and id = 108, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_18 and id = 112, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+Created a USER with name Ex01_User_19 and id = 116, connected to Router0, and with 5 gridlets. Registered to Ex01_Regional_GIS
+
+Starting GridSim version 4.0
+Entities started.
+Ex01_User_17: initial SUBMIT_GRIDLET event will be at clock: 218. Current clock: 0.0
+Ex01_User_1: initial SUBMIT_GRIDLET event will be at clock: 12. Current clock: 0.0
+Ex01_User_10: initial SUBMIT_GRIDLET event will be at clock: 197. Current clock: 0.0
+Ex01_User_0: initial SUBMIT_GRIDLET event will be at clock: 194. Current clock: 0.0
+Ex01_User_3: initial SUBMIT_GRIDLET event will be at clock: 173. Current clock: 0.0
+Ex01_User_6: initial SUBMIT_GRIDLET event will be at clock: 112. Current clock: 0.0
+Ex01_User_2: initial SUBMIT_GRIDLET event will be at clock: 132. Current clock: 0.0
+Ex01_User_7: initial SUBMIT_GRIDLET event will be at clock: 197. Current clock: 0.0
+Ex01_User_11: initial SUBMIT_GRIDLET event will be at clock: 158. Current clock: 0.0
+Ex01_User_8: initial SUBMIT_GRIDLET event will be at clock: 50. Current clock: 0.0
+Ex01_User_16: initial SUBMIT_GRIDLET event will be at clock: 253. Current clock: 0.0
+Ex01_User_14: initial SUBMIT_GRIDLET event will be at clock: 159. Current clock: 0.0
+Ex01_User_15: initial SUBMIT_GRIDLET event will be at clock: 238. Current clock: 0.0
+Ex01_User_19: initial SUBMIT_GRIDLET event will be at clock: 7. Current clock: 0.0
+Ex01_User_5: initial SUBMIT_GRIDLET event will be at clock: 98. Current clock: 0.0
+Ex01_User_13: initial SUBMIT_GRIDLET event wi...
[truncated message content] |