Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
batsim
batsim
Commits
f747a2e8
Commit
f747a2e8
authored
Aug 14, 2017
by
Steffen Lackner
Browse files
[code] Implement data staging (communication between storage tiers)
parent
688ab155
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/jobs_execution.cpp
View file @
f747a2e8
...
...
@@ -188,8 +188,55 @@ int execute_profile(BatsimContext *context,
double
cpu
=
0
;
double
size
=
data
->
size
;
// TODO
xbt_die
(
"TODO"
);
// The PFS machine will also be used
nb_res
=
2
;
int
pfs_id
=
nb_res
-
1
;
hosts_to_use
=
std
::
vector
<
msg_host_t
>
();
// Add the pfs_machine
switch
(
data
->
direction
)
{
case
MsgDataStagingProfileData
::
Direction
::
LCST_TO_HPST
:
hosts_to_use
.
push_back
(
context
->
machines
.
pfs_machine
()
->
host
);
hosts_to_use
.
push_back
(
context
->
machines
.
hpst_machine
()
->
host
);
break
;
case
MsgDataStagingProfileData
::
Direction
::
HPST_TO_LCST
:
hosts_to_use
.
push_back
(
context
->
machines
.
hpst_machine
()
->
host
);
hosts_to_use
.
push_back
(
context
->
machines
.
pfs_machine
()
->
host
);
break
;
default:
xbt_die
(
"Should not be reached"
);
}
// These amounts are deallocated by SG
computation_amount
=
xbt_new
(
double
,
nb_res
);
communication_amount
=
nullptr
;
if
(
size
>
0
)
{
communication_amount
=
xbt_new
(
double
,
nb_res
*
nb_res
);
}
// Let us fill the local computation and communication matrices
int
k
=
0
;
for
(
int
y
=
0
;
y
<
nb_res
;
++
y
)
{
computation_amount
[
y
]
=
cpu
;
if
(
communication_amount
!=
nullptr
)
{
for
(
int
x
=
0
;
x
<
nb_res
;
++
x
)
{
// Communications are done towards the last resource
if
(
x
!=
pfs_id
)
{
communication_amount
[
k
++
]
=
0
;
}
else
{
communication_amount
[
k
++
]
=
size
;
}
}
}
}
}
string
task_name
=
task_name_prefix
+
to_string
(
job
->
number
)
+
"'"
+
job
->
profile
+
"'"
;
...
...
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