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
a7559218
Unverified
Commit
a7559218
authored
Dec 08, 2021
by
Thien Nguyen
Committed by
GitHub
Dec 08, 2021
Browse files
Merge pull request #505 from 1tnguyen/tnguyen/honeywell-status
Handle Honeywell Accelerator backend status
parents
681830d1
ff34c92a
Pipeline
#180696
passed with stage
in 13 minutes and 11 seconds
Changes
1
Pipelines
9
Hide whitespace changes
Inline
Side-by-side
quantum/plugins/honeywell/honeywell.cpp
View file @
a7559218
...
...
@@ -167,13 +167,24 @@ void HoneywellAccelerator::execute(
"Please specify a honeywell backend in your getAccelerator() call."
);
}
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."
);
while
(
true
)
{
auto
backend_status
=
get
(
url
,
"machine/"
+
backend
,
generateRequestHeader
());
auto
status_J
=
nlohmann
::
json
::
parse
(
backend_status
);
// xacc::info("\nHoneywell status:\n" + backend_status);
// If offline, terminate
if
(
status_J
[
"state"
]
==
"offline"
)
{
xacc
::
error
(
"Cannot run on "
+
backend
+
", it is offline."
);
}
// If online, continue to run
if
(
status_J
[
"state"
]
==
"online"
)
{
break
;
}
// If status = 'in maintenance', wait for a bit and try again
xacc
::
info
(
"Honeywell is '"
+
std
::
string
(
status_J
[
"state"
])
+
"', waiting for a bit..."
);
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
60
));
}
xacc
::
info
(
"
\n
Honeywell sending qasm:
\n
"
+
qasm
);
nlohmann
::
json
j
;
...
...
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