Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
ca57febd
Commit
ca57febd
authored
Aug 24, 2021
by
Mccaskey, Alex
Browse files
add check for backend status, error if offline. add job id and progress text
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
25f91a93
Pipeline
#160803
passed with stage
in 37 minutes and 41 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
quantum/plugins/honeywell/honeywell.cpp
View file @
ca57febd
...
...
@@ -168,6 +168,12 @@ void HoneywellAccelerator::execute(
}
auto
qasm
=
getNativeCode
(
circuit
);
auto
backend_status
=
get
(
url
,
"machine/"
+
backend
,
generateRequestHeader
());
auto
status_J
=
nlohmann
::
json
::
parse
(
backend_status
);
if
(
status_J
[
"state"
]
!=
"online"
)
{
xacc
::
error
(
"Cannot run on "
+
backend
+
", it is not online."
);
}
xacc
::
info
(
"
\n
Honeywell sending qasm:
\n
"
+
qasm
);
nlohmann
::
json
j
;
...
...
@@ -209,6 +215,19 @@ void HoneywellAccelerator::execute(
if
(
get_job_status_json
[
"status"
].
get
<
std
::
string
>
()
==
"completed"
)
{
break
;
}
if
(
dots
>
4
)
dots
=
1
;
std
::
stringstream
ss
;
ss
<<
"
\033
[0;32m"
<<
"Honeywell Job "
<<
"
\033
[0;36m"
<<
job_id
<<
"
\033
[0;32m"
<<
" Status: "
<<
get_job_status_json
[
"status"
].
get
<
std
::
string
>
();
for
(
int
i
=
0
;
i
<
dots
;
i
++
)
ss
<<
'.'
;
dots
++
;
std
::
cout
<<
'\r'
<<
ss
.
str
()
<<
std
::
setw
(
20
)
<<
std
::
setfill
(
' '
)
<<
std
::
flush
;
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
100
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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