Commit dfea6290 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Limit QLM core count in power access mode (qlmaas)



The scheduler on the QLM will not allow more than 75 cores to be used for any single jobs.

Depending on the problem size (number of qubits), the QLM may pick an optimal core count exceeding this limit, hence needs to specifically limit the core count.
Signed-off-by: Nguyen, Thien Minh's avatarThien Nguyen <nguyentm@ornl.gov>
parent 38665a08
......@@ -30,6 +30,8 @@ namespace {
// By default, this accelerator targets ORNL's QLM installation.
// It can be used w/ other QLM by providing the host address explicitly.
const std::string QLM_HOST_NAME = "quantumbull.ornl.gov";
// Remote access QLM (via qlmaas) limits the number of CPU threads.
constexpr int QLMAAS_MAX_CORE_COUNT = 75;
inline bool isMeasureGate(const xacc::InstPtr &in_instr) {
return (in_instr->name() == "Measure");
......@@ -1010,7 +1012,7 @@ void QlmAccelerator::execute(
if (!m_remoteAccess) {
return m_qlmQpuServer.attr("submit")(qlmJob);
} else {
auto asynchronous_result = m_qlmQpuServer.attr("submit")(qlmJob);
auto asynchronous_result = m_qlmQpuServer.attr("submit")(qlmJob, "core_usage"_a = QLMAAS_MAX_CORE_COUNT);
// wait
auto sync_result = asynchronous_result.attr("join")();
return sync_result;
......@@ -1039,7 +1041,7 @@ void QlmAccelerator::execute(
if (!m_remoteAccess) {
return m_qlmQpuServer.attr("submit")(qlmJob);
} else {
auto asynchronous_result = m_qlmQpuServer.attr("submit")(qlmJob);
auto asynchronous_result = m_qlmQpuServer.attr("submit")(qlmJob, "core_usage"_a = QLMAAS_MAX_CORE_COUNT);
// wait
auto sync_result = asynchronous_result.attr("join")();
return sync_result;
......@@ -1068,7 +1070,7 @@ void QlmAccelerator::execute(
if (!m_remoteAccess) {
return m_qlmQpuServer.attr("submit")(batch);
} else {
auto asynchronous_result = m_qlmQpuServer.attr("submit")(batch);
auto asynchronous_result = m_qlmQpuServer.attr("submit")(batch, "core_usage"_a = QLMAAS_MAX_CORE_COUNT);
// wait
auto sync_result = asynchronous_result.attr("join")();
return sync_result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment