Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gpucloudsim
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LPDS
gpucloudsim
Commits
50eda753
Commit
50eda753
authored
Feb 08, 2011
by
rodrigo.calheiros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes.
parent
41ed465a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
158 additions
and
5 deletions
+158
-5
CloudletSchedulerSpaceShared.java
...a/org/cloudbus/cloudsim/CloudletSchedulerSpaceShared.java
+1
-4
Datacenter.java
...udsim/src/main/java/org/cloudbus/cloudsim/Datacenter.java
+4
-0
FederatedDatacenter.java
.../main/java/org/cloudbus/cloudsim/FederatedDatacenter.java
+1
-1
Host.java
...es/cloudsim/src/main/java/org/cloudbus/cloudsim/Host.java
+20
-0
ResCloudlet.java
...dsim/src/main/java/org/cloudbus/cloudsim/ResCloudlet.java
+1
-0
CloudSim.java
...im/src/main/java/org/cloudbus/cloudsim/core/CloudSim.java
+18
-0
FutureQueue.java
...src/main/java/org/cloudbus/cloudsim/core/FutureQueue.java
+10
-0
SimEntity.java
...m/src/main/java/org/cloudbus/cloudsim/core/SimEntity.java
+103
-0
No files found.
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/CloudletSchedulerSpaceShared.java
View file @
50eda753
...
...
@@ -145,7 +145,6 @@ public class CloudletSchedulerSpaceShared extends CloudletScheduler {
nextEvent
=
estimatedFinishTime
;
}
}
setPreviousTime
(
currentTime
);
return
nextEvent
;
}
...
...
@@ -187,7 +186,7 @@ public class CloudletSchedulerSpaceShared extends CloudletScheduler {
for
(
ResCloudlet
rcl
:
getCloudletPausedList
())
{
if
(
rcl
.
getCloudletId
()
==
cloudletId
)
{
getCloudletPausedList
().
remove
(
rcl
);
rcl
.
getCloudlet
();
r
eturn
r
cl
.
getCloudlet
();
}
}
...
...
@@ -383,7 +382,6 @@ public class CloudletSchedulerSpaceShared extends CloudletScheduler {
}
else
{
// no enough free PEs: go to the waiting queue
ResCloudlet
rcl
=
new
ResCloudlet
(
cloudlet
);
rcl
.
setCloudletStatus
(
Cloudlet
.
QUEUED
);
getCloudletWaitingList
().
add
(
rcl
);
return
0.0
;
}
...
...
@@ -407,7 +405,6 @@ public class CloudletSchedulerSpaceShared extends CloudletScheduler {
long
length
=
cloudlet
.
getCloudletLength
();
length
+=
extraSize
;
cloudlet
.
setCloudletLength
(
length
);
return
cloudlet
.
getCloudletLength
()
/
capacity
;
}
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/Datacenter.java
View file @
50eda753
...
...
@@ -93,6 +93,10 @@ public class Datacenter extends SimEntity {
setStorageList
(
storageList
);
setVmList
(
new
ArrayList
<
Vm
>());
setSchedulingInterval
(
schedulingInterval
);
for
(
Host
host:
getCharacteristics
().
getHostList
())
{
host
.
setDatacenter
(
this
);
}
// If this resource doesn't have any PEs then no useful at all
if
(
getCharacteristics
().
getPesNumber
()
==
0
)
{
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/FederatedDatacenter.java
View file @
50eda753
...
...
@@ -100,7 +100,7 @@ public class FederatedDatacenter extends SimEntity {
setDebts
(
new
HashMap
<
Integer
,
Double
>());
setStorageList
(
storageList
);
setVmList
(
new
ArrayList
<
Vm
>());
// If this resource doesn't have any PEs then no useful at all
if
(
getCharacteristics
().
getPesNumber
()
==
0
)
{
throw
new
Exception
(
super
.
getName
()
+
" : Error - this entity has no PEs. Therefore, can't process any Cloudlets."
);
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/Host.java
View file @
50eda753
...
...
@@ -56,6 +56,9 @@ public class Host {
/** The vms migrating in. */
private
List
<
Vm
>
vmsMigratingIn
;
/** THe datacenter where the host is placed */
private
Datacenter
datacenter
;
/**
* Instantiates a new host.
...
...
@@ -582,5 +585,22 @@ public class Host {
protected
void
setVmsMigratingIn
(
List
<
Vm
>
vmsMigratingIn
)
{
this
.
vmsMigratingIn
=
vmsMigratingIn
;
}
/**
* Gets the data center.
* @return the data center where the host runs
*/
public
Datacenter
getDatacenter
(){
return
this
.
datacenter
;
}
/**
* Sets the data center.
*
* @param datacenter the data center from this host
*/
public
void
setDatacenter
(
Datacenter
datacenter
)
{
this
.
datacenter
=
datacenter
;
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/ResCloudlet.java
View file @
50eda753
...
...
@@ -346,6 +346,7 @@ public class ResCloudlet {
startExecTime
=
clock
;
cloudlet
.
setExecStartTime
(
startExecTime
);
}
}
catch
(
Exception
e
)
{
success
=
false
;
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/core/CloudSim.java
View file @
50eda753
...
...
@@ -543,6 +543,24 @@ public class CloudSim {
SimEvent
e
=
new
SimEvent
(
SimEvent
.
SEND
,
clock
+
delay
,
src
,
dest
,
tag
,
data
);
future
.
addEvent
(
e
);
}
/**
* Used to send an event from one entity to another, with priority in the queue.
*
* @param src the src
* @param dest the dest
* @param delay the delay
* @param tag the tag
* @param data the data
*/
public
static
void
sendFirst
(
int
src
,
int
dest
,
double
delay
,
int
tag
,
Object
data
)
{
if
(
delay
<
0
)
{
throw
new
IllegalArgumentException
(
"Send delay can't be negative."
);
}
SimEvent
e
=
new
SimEvent
(
SimEvent
.
SEND
,
clock
+
delay
,
src
,
dest
,
tag
,
data
);
future
.
addEventFirst
(
e
);
}
/**
* Sets an entity's state to be waiting. The predicate used to wait for an event
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/core/FutureQueue.java
View file @
50eda753
...
...
@@ -41,6 +41,16 @@ public class FutureQueue {
newEvent
.
setSerial
(
serial
++);
sortedSet
.
add
(
newEvent
);
}
/**
* Add a new event to the head of the queue.
*
* @param newEvent The event to be put in the queue.
*/
public
void
addEventFirst
(
SimEvent
newEvent
)
{
newEvent
.
setSerial
(
0
);
sortedSet
.
add
(
newEvent
);
}
/**
* Returns an iterator to the queue.
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/core/SimEntity.java
View file @
50eda753
...
...
@@ -183,6 +183,109 @@ public abstract class SimEntity implements Cloneable {
public
void
scheduleNow
(
String
dest
,
int
tag
)
{
schedule
(
dest
,
0
,
tag
,
null
);
}
/**
* Send a high priority event to another entity by id number, with data. Note that the
* tag <code>9999</code> is reserved.
*
* @param dest The unique id number of the destination entity
* @param delay How long from the current simulation time the event
* should be sent
* @param tag An user-defined number representing the type of event.
* @param data The data to be sent with the event.
*/
public
void
scheduleFirst
(
int
dest
,
double
delay
,
int
tag
,
Object
data
)
{
if
(!
CloudSim
.
running
())
{
return
;
}
CloudSim
.
sendFirst
(
id
,
dest
,
delay
,
tag
,
data
);
}
/**
* Send a high priority event to another entity by id number and with <b>no</b> data.
* Note that the tag <code>9999</code> is reserved.
*
* @param dest The unique id number of the destination entity
* @param delay How long from the current simulation time the event
* should be sent
* @param tag An user-defined number representing the type of event.
*/
public
void
scheduleFirst
(
int
dest
,
double
delay
,
int
tag
)
{
scheduleFirst
(
dest
,
delay
,
tag
,
null
);
}
/**
* Send a high priority event to another entity through a port with a given name, with
* data. Note that the tag <code>9999</code> is reserved.
*
* @param dest The name of the port to send the event through
* @param delay How long from the current simulation time the event
* should be sent
* @param tag An user-defined number representing the type of event.
* @param data The data to be sent with the event.
*/
public
void
scheduleFirst
(
String
dest
,
double
delay
,
int
tag
,
Object
data
)
{
scheduleFirst
(
CloudSim
.
getEntityId
(
dest
),
delay
,
tag
,
data
);
}
/**
* Send a high priority event to another entity through a port with a given name, with
* <b>no</b> data. Note that the tag <code>9999</code> is reserved.
*
* @param dest The name of the port to send the event through
* @param delay How long from the current simulation time the event should be
* sent
* @param tag An user-defined number representing the type of event.
*/
public
void
scheduleFirst
(
String
dest
,
double
delay
,
int
tag
)
{
scheduleFirst
(
dest
,
delay
,
tag
,
null
);
}
/**
* Send a high priority event to another entity by id number, with data. Note that the
* tag <code>9999</code> is reserved.
*
* @param dest The unique id number of the destination entity
* @param tag An user-defined number representing the type of event.
* @param data The data to be sent with the event.
*/
public
void
scheduleFirstNow
(
int
dest
,
int
tag
,
Object
data
)
{
scheduleFirst
(
dest
,
0
,
tag
,
data
);
}
/**
* Send a high priority event to another entity by id number and with <b>no</b> data.
* Note that the tag <code>9999</code> is reserved.
*
* @param dest The unique id number of the destination entity
* @param tag An user-defined number representing the type of event.
*/
public
void
scheduleFirstNow
(
int
dest
,
int
tag
)
{
scheduleFirst
(
dest
,
0
,
tag
,
null
);
}
/**
* Send a high priority event to another entity through a port with a given name, with
* data. Note that the tag <code>9999</code> is reserved.
*
* @param dest The name of the port to send the event through
* @param tag An user-defined number representing the type of event.
* @param data The data to be sent with the event.
*/
public
void
scheduleFirstNow
(
String
dest
,
int
tag
,
Object
data
)
{
scheduleFirst
(
CloudSim
.
getEntityId
(
dest
),
0
,
tag
,
data
);
}
/**
* Send a high priority event to another entity through a port with a given name, with
* <b>no</b> data. Note that the tag <code>9999</code> is reserved.
*
* @param dest The name of the port to send the event through
* @param tag An user-defined number representing the type of event.
*/
public
void
scheduleFirstNow
(
String
dest
,
int
tag
)
{
scheduleFirst
(
dest
,
0
,
tag
,
null
);
}
/**
* Set the entity to be inactive for a time period.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment