Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always clear threadToQpuId when we clear platformQPUs #2478

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions runtime/cudaq/platform/mqpu/MultiQPUPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
// Make sure that we clean up the client QPUs first before cleaning up the
// remote servers.
platformQPUs.clear();
threadToQpuId.clear();
platformNumQPUs = 0;
m_remoteServers.clear();
}
Expand Down Expand Up @@ -154,6 +155,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
qpuSubType));
if (qpuSubType == "NvcfSimulatorQPU") {
platformQPUs.clear();
threadToQpuId.clear();
auto simName = getOpt(description, "backend");
if (simName.empty())
simName = "custatevec-fp32";
Expand Down Expand Up @@ -199,6 +201,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
} else if (qpuSubType == "orca") {
auto urls = cudaq::split(getOpt(description, "url"), ',');
platformQPUs.clear();
threadToQpuId.clear();
for (std::size_t qId = 0; qId < urls.size(); ++qId) {
// Populate the information and add the QPUs
platformQPUs.emplace_back(cudaq::registry::get<cudaq::QPU>("orca"));
Expand Down Expand Up @@ -244,6 +247,7 @@ class MultiQPUQuantumPlatform : public cudaq::quantum_platform {
"receiving {}, expecting {}.",
sims.size(), urls.size()));
platformQPUs.clear();
threadToQpuId.clear();
for (std::size_t qId = 0; qId < urls.size(); ++qId) {
const auto simName = sims.size() == 1 ? sims.front() : sims[qId];
// Populate the information and add the QPUs
Expand Down
Loading