|
From: <mar...@us...> - 2008-01-29 03:58:02
|
Revision: 84
http://gridsim.svn.sourceforge.net/gridsim/?rev=84&view=rev
Author: marcos_dias
Date: 2008-01-28 19:58:08 -0800 (Mon, 28 Jan 2008)
Log Message:
-----------
This commit fixes a bug in GridSim, which allowed a simulation to run out of memory due to excessive trace even when the user chose not to record any statistics.
Modified Paths:
--------------
branches/gridsim4.0-branch3/source/gridsim/GridSim.java
branches/gridsim4.0-branch3/source/gridsim/util/Workload.java
Modified: branches/gridsim4.0-branch3/source/gridsim/GridSim.java
===================================================================
--- branches/gridsim4.0-branch3/source/gridsim/GridSim.java 2008-01-15 03:33:59 UTC (rev 83)
+++ branches/gridsim4.0-branch3/source/gridsim/GridSim.java 2008-01-29 03:58:08 UTC (rev 84)
@@ -123,6 +123,7 @@
private static Calendar calendar_ = null; // a Calendar object
private static GridInformationService gis_ = null; // a GIS object
private final static int NOT_FOUND = -1; // a constant
+ private static boolean traceFlag_;
////////////////////////////////////////////////////////////////////////
@@ -701,6 +702,8 @@
if (cal == null) {
calendar_ = Calendar.getInstance();
}
+
+ traceFlag_ = traceFlag;
SimulationStartDate = calendar_.getTime();
rand = new GridSimRandom();
@@ -2126,6 +2129,15 @@
}
/**
+ * Checks whether simulation's statistics of other log should be created
+ * @return <tt>true</tt> if the information should be logged
+ * or <tt>false</tt> otherwise.
+ */
+ public static boolean isTraceEnabled() {
+ return traceFlag_;
+ }
+
+ /**
* Gets the total number of PEs (Processing Elements) from a resource
* @param resourceID a resource ID
* @return total number of PE or <tt>-1</tt> if invalid resource ID
Modified: branches/gridsim4.0-branch3/source/gridsim/util/Workload.java
===================================================================
--- branches/gridsim4.0-branch3/source/gridsim/util/Workload.java 2008-01-15 03:33:59 UTC (rev 83)
+++ branches/gridsim4.0-branch3/source/gridsim/util/Workload.java 2008-01-29 03:58:08 UTC (rev 84)
@@ -737,7 +737,7 @@
{
// create the gridlet
int len = runTime * rating_; // calculate a job length for each PE
- Gridlet gl = new Gridlet(id, len, size_, size_);
+ Gridlet gl = new Gridlet(id, len, size_, size_, GridSim.isTraceEnabled());
gl.setUserID( super.get_id() ); // set the owner ID
gl.setNumPE(numProc); // set the requested num of proc
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|