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
a7774e02
Commit
a7774e02
authored
Aug 17, 2017
by
Steffen Lackner
Browse files
[code] send additional status information to the scheduler
parent
6f5d650a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/protocol.cpp
View file @
a7774e02
...
...
@@ -157,6 +157,8 @@ void JsonProtocolWriter::append_job_submitted(const string & job_id,
void
JsonProtocolWriter
::
append_job_completed
(
const
string
&
job_id
,
const
string
&
job_status
,
const
string
&
job_state
,
const
string
&
kill_reason
,
double
date
)
{
/* {
...
...
@@ -174,6 +176,8 @@ void JsonProtocolWriter::append_job_completed(const string & job_id,
Value
data
(
rapidjson
::
kObjectType
);
data
.
AddMember
(
"job_id"
,
Value
().
SetString
(
job_id
.
c_str
(),
_alloc
),
_alloc
);
data
.
AddMember
(
"status"
,
Value
().
SetString
(
job_status
.
c_str
(),
_alloc
),
_alloc
);
data
.
AddMember
(
"job_state"
,
Value
().
SetString
(
job_state
.
c_str
(),
_alloc
),
_alloc
);
data
.
AddMember
(
"kill_reason"
,
Value
().
SetString
(
kill_reason
.
c_str
(),
_alloc
),
_alloc
);
Value
event
(
rapidjson
::
kObjectType
);
event
.
AddMember
(
"timestamp"
,
Value
().
SetDouble
(
date
),
_alloc
);
...
...
src/protocol.hpp
View file @
a7774e02
...
...
@@ -106,6 +106,8 @@ public:
*/
virtual
void
append_job_completed
(
const
std
::
string
&
job_id
,
const
std
::
string
&
job_status
,
const
std
::
string
&
job_state
,
const
std
::
string
&
kill_reason
,
double
date
)
=
0
;
/**
...
...
@@ -222,6 +224,8 @@ public:
*/
void
append_job_completed
(
const
std
::
string
&
job_id
,
const
std
::
string
&
job_status
,
const
std
::
string
&
job_state
,
const
std
::
string
&
kill_reason
,
double
date
);
/**
...
...
src/server.cpp
View file @
a7774e02
...
...
@@ -212,8 +212,31 @@ void server_on_job_completed(ServerData * data,
status
=
"TIMEOUT"
;
}
string
job_state
;
switch
(
job
->
state
)
{
case
JobState
::
JOB_STATE_NOT_SUBMITTED
:
job_state
=
"NOT_SUBMITTED"
;
break
;
case
JobState
::
JOB_STATE_SUBMITTED
:
job_state
=
"SUBMITTED"
;
break
;
case
JobState
::
JOB_STATE_RUNNING
:
job_state
=
"RUNNING"
;
break
;
case
JobState
::
JOB_STATE_COMPLETED_SUCCESSFULLY
:
job_state
=
"COMPLETED_SUCCESSFULLY"
;
break
;
case
JobState
::
JOB_STATE_COMPLETED_KILLED
:
job_state
=
"COMPLETED_KILLED"
;
break
;
case
JobState
::
JOB_STATE_REJECTED
:
job_state
=
"REJECTED"
;
break
;
}
data
->
context
->
proto_writer
->
append_job_completed
(
message
->
job_id
.
to_string
(),
status
,
MSG_get_clock
());
status
,
job_state
,
job
->
kill_reason
,
MSG_get_clock
());
check_submitted_and_completed
(
data
);
}
...
...
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