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
c3a72367
Commit
c3a72367
authored
Jun 11, 2022
by
Ahmad Siavashi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add isGpuEquipped method to GpuHost
parent
4f096fa3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
GpuHost.java
...dsim/src/main/java/org/cloudbus/cloudsim/gpu/GpuHost.java
+9
-7
GpuVmAllocationPolicy.java
...java/org/cloudbus/cloudsim/gpu/GpuVmAllocationPolicy.java
+1
-2
GridGpuVmAllocationPolicyBestFit.java
...dware_assisted/grid/GridGpuVmAllocationPolicyBestFit.java
+1
-2
No files found.
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/GpuHost.java
View file @
c3a72367
...
@@ -76,7 +76,7 @@ public class GpuHost extends Host {
...
@@ -76,7 +76,7 @@ public class GpuHost extends Host {
@Override
@Override
public
boolean
isSuitableForVm
(
Vm
vm
)
{
public
boolean
isSuitableForVm
(
Vm
vm
)
{
boolean
result
=
vmCreate
(
vm
);
boolean
result
=
vmCreate
(
vm
);
if
(
result
)
{
if
(
result
)
{
vmDestroy
(
vm
);
vmDestroy
(
vm
);
}
}
return
result
;
return
result
;
...
@@ -103,7 +103,7 @@ public class GpuHost extends Host {
...
@@ -103,7 +103,7 @@ public class GpuHost extends Host {
* @return
* @return
*/
*/
public
boolean
hasVideoCard
(
int
videoCardId
)
{
public
boolean
hasVideoCard
(
int
videoCardId
)
{
if
(
getVideoCardAllocationPolicy
()
==
null
||
getVideoCardAllocationPolicy
().
getVideoCards
().
isEmpty
())
{
if
(
!
isGpuEquipped
())
{
return
false
;
return
false
;
}
}
for
(
VideoCard
videoCard
:
getVideoCardAllocationPolicy
().
getVideoCards
())
{
for
(
VideoCard
videoCard
:
getVideoCardAllocationPolicy
().
getVideoCards
())
{
...
@@ -121,7 +121,7 @@ public class GpuHost extends Host {
...
@@ -121,7 +121,7 @@ public class GpuHost extends Host {
* @return
* @return
*/
*/
public
boolean
hasPgpu
(
int
pgpuId
)
{
public
boolean
hasPgpu
(
int
pgpuId
)
{
if
(
getVideoCardAllocationPolicy
()
==
null
||
getVideoCardAllocationPolicy
().
getVideoCards
().
isEmpty
())
{
if
(
!
isGpuEquipped
())
{
return
false
;
return
false
;
}
}
for
(
VideoCard
videoCard
:
getVideoCardAllocationPolicy
().
getVideoCards
())
{
for
(
VideoCard
videoCard
:
getVideoCardAllocationPolicy
().
getVideoCards
())
{
...
@@ -134,6 +134,10 @@ public class GpuHost extends Host {
...
@@ -134,6 +134,10 @@ public class GpuHost extends Host {
return
false
;
return
false
;
}
}
public
boolean
isGpuEquipped
()
{
return
getVideoCardAllocationPolicy
()
!=
null
&&
!
getVideoCardAllocationPolicy
().
getVideoCards
().
isEmpty
();
}
public
void
vgpuDestroy
(
Vgpu
vgpu
)
{
public
void
vgpuDestroy
(
Vgpu
vgpu
)
{
if
(
vgpu
!=
null
)
{
if
(
vgpu
!=
null
)
{
getVideoCardAllocationPolicy
().
deallocate
(
vgpu
);
getVideoCardAllocationPolicy
().
deallocate
(
vgpu
);
...
@@ -163,9 +167,7 @@ public class GpuHost extends Host {
...
@@ -163,9 +167,7 @@ public class GpuHost extends Host {
}
}
public
Set
<
Vgpu
>
getVgpuSet
()
{
public
Set
<
Vgpu
>
getVgpuSet
()
{
if
(
getVideoCardAllocationPolicy
()
==
null
)
{
if
(!
isGpuEquipped
())
{
return
null
;
}
else
if
(
getVideoCardAllocationPolicy
().
getVideoCards
().
isEmpty
())
{
return
null
;
return
null
;
}
}
return
getVideoCardAllocationPolicy
().
getVgpuVideoCardMap
().
keySet
();
return
getVideoCardAllocationPolicy
().
getVgpuVideoCardMap
().
keySet
();
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/GpuVmAllocationPolicy.java
View file @
c3a72367
...
@@ -149,8 +149,7 @@ public abstract class GpuVmAllocationPolicy extends VmAllocationPolicy {
...
@@ -149,8 +149,7 @@ public abstract class GpuVmAllocationPolicy extends VmAllocationPolicy {
protected
void
setGpuHostList
(
List
<
GpuHost
>
gpuHostList
)
{
protected
void
setGpuHostList
(
List
<
GpuHost
>
gpuHostList
)
{
this
.
gpuHostList
=
new
ArrayList
<
GpuHost
>();
this
.
gpuHostList
=
new
ArrayList
<
GpuHost
>();
for
(
GpuHost
host
:
gpuHostList
)
{
for
(
GpuHost
host
:
gpuHostList
)
{
if
(
host
.
getVideoCardAllocationPolicy
()
!=
null
if
(
host
.
isGpuEquipped
())
{
&&
!
host
.
getVideoCardAllocationPolicy
().
getVideoCards
().
isEmpty
())
{
getGpuHostList
().
add
(
host
);
getGpuHostList
().
add
(
host
);
}
}
}
}
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/hardware_assisted/grid/GridGpuVmAllocationPolicyBestFit.java
View file @
c3a72367
...
@@ -43,8 +43,7 @@ public class GridGpuVmAllocationPolicyBestFit extends GpuVmAllocationPolicy {
...
@@ -43,8 +43,7 @@ public class GridGpuVmAllocationPolicyBestFit extends GpuVmAllocationPolicy {
// Create nonGpuHost list
// Create nonGpuHost list
for
(
Host
host
:
list
)
{
for
(
Host
host
:
list
)
{
GpuHost
pm
=
(
GpuHost
)
host
;
GpuHost
pm
=
(
GpuHost
)
host
;
if
(
pm
.
getVideoCardAllocationPolicy
()
==
null
if
(!
pm
.
isGpuEquipped
())
{
||
pm
.
getVideoCardAllocationPolicy
().
getVideoCards
().
isEmpty
())
{
nonGpuHostList
.
add
(
pm
);
nonGpuHostList
.
add
(
pm
);
}
}
}
}
...
...
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