Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
batsim
batsim
Commits
a45bf390
Commit
a45bf390
authored
Aug 19, 2017
by
Steffen Lackner
Browse files
[code] Send configuration of time sharing to scheduler
parent
d7bf6725
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/protocol.cpp
View file @
a45bf390
...
@@ -46,6 +46,7 @@ void JsonProtocolWriter::append_requested_call(double date)
...
@@ -46,6 +46,7 @@ void JsonProtocolWriter::append_requested_call(double date)
void
JsonProtocolWriter
::
append_simulation_begins
(
Machines
&
machines
,
void
JsonProtocolWriter
::
append_simulation_begins
(
Machines
&
machines
,
const
Document
&
configuration
,
const
Document
&
configuration
,
bool
allow_time_sharing
,
double
date
)
double
date
)
{
{
/* {
/* {
...
@@ -63,6 +64,7 @@ void JsonProtocolWriter::append_simulation_begins(Machines & machines,
...
@@ -63,6 +64,7 @@ void JsonProtocolWriter::append_simulation_begins(Machines & machines,
Value
data
(
rapidjson
::
kObjectType
);
Value
data
(
rapidjson
::
kObjectType
);
data
.
AddMember
(
"nb_resources"
,
Value
().
SetInt
(
machines
.
nb_machines
()),
_alloc
);
data
.
AddMember
(
"nb_resources"
,
Value
().
SetInt
(
machines
.
nb_machines
()),
_alloc
);
data
.
AddMember
(
"allow_time_sharing"
,
Value
().
SetBool
(
allow_time_sharing
),
_alloc
);
data
.
AddMember
(
"config"
,
config
,
_alloc
);
data
.
AddMember
(
"config"
,
config
,
_alloc
);
Value
resources
(
rapidjson
::
kArrayType
);
Value
resources
(
rapidjson
::
kArrayType
);
...
...
src/protocol.hpp
View file @
a45bf390
...
@@ -78,6 +78,7 @@ public:
...
@@ -78,6 +78,7 @@ public:
*/
*/
virtual
void
append_simulation_begins
(
Machines
&
machines
,
virtual
void
append_simulation_begins
(
Machines
&
machines
,
const
rapidjson
::
Document
&
configuration
,
const
rapidjson
::
Document
&
configuration
,
bool
allow_time_sharing
,
double
date
)
=
0
;
double
date
)
=
0
;
/**
/**
...
@@ -196,6 +197,7 @@ public:
...
@@ -196,6 +197,7 @@ public:
*/
*/
void
append_simulation_begins
(
Machines
&
machines
,
void
append_simulation_begins
(
Machines
&
machines
,
const
rapidjson
::
Document
&
configuration
,
const
rapidjson
::
Document
&
configuration
,
bool
allow_time_sharing
,
double
date
);
double
date
);
/**
/**
...
...
src/server.cpp
View file @
a45bf390
...
@@ -34,7 +34,9 @@ int server_process(int argc, char *argv[])
...
@@ -34,7 +34,9 @@ int server_process(int argc, char *argv[])
// Let's tell the Decision process that the simulation is about to begin
// Let's tell the Decision process that the simulation is about to begin
// (and that some data can be read from the data storage)
// (and that some data can be read from the data storage)
context
->
proto_writer
->
append_simulation_begins
(
context
->
machines
,
context
->
proto_writer
->
append_simulation_begins
(
context
->
machines
,
context
->
config_file
,
MSG_get_clock
());
context
->
config_file
,
context
->
allow_time_sharing
,
MSG_get_clock
());
RequestReplyProcessArguments
*
req_rep_args
=
new
RequestReplyProcessArguments
;
RequestReplyProcessArguments
*
req_rep_args
=
new
RequestReplyProcessArguments
;
req_rep_args
->
context
=
context
;
req_rep_args
->
context
=
context
;
...
...
Write
Preview
Supports
Markdown
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