Skip to content

Commit

Permalink
multi-pilot changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmanthasf committed Jul 16, 2024
1 parent 211ef98 commit 0c97a91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/pq_multi_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def circuit(parameters):
# Submit tasks to pcs
tasks = []
for i in range(1000):
k = pcs.submit_task(f"task_pennylane-{i}", pennylane_quantum_circuit)
k = pcs.submit_task(pennylane_quantum_circuit, task_name = f"task_pennylane-{i}" )
tasks.append(k)

for i in range(1000):
k = pcs.submit_task(f"task_pennylane-{i}", pennylane_quantum_circuit, pilot=pilots[0])
k = pcs.submit_task(pennylane_quantum_circuit, task_name = f"task_pennylane-{i}", pilot=pilots[0])
tasks.append(k)


Expand Down
7 changes: 6 additions & 1 deletion pilot/pilot_compute_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_client(self):
"""
return self.cluster_manager.get_client()

def submit_task(self, task_name, func, *args, **kwargs):
def submit_task(self, func, *args, **kwargs):
pilot_scheduled = 'ANY'

if kwargs.get("pilot"):
Expand All @@ -146,6 +146,11 @@ def submit_task(self, task_name, func, *args, **kwargs):
pilot_scheduled = kwargs["pilot"]
del kwargs["pilot"]

task_name = kwargs.get("task_name", f"task-{uuid.uuid4()}")
if kwargs.get("task_name"):
del kwargs["task_name"]


if not self.client:
self.client = self.get_client()

Expand Down

0 comments on commit 0c97a91

Please sign in to comment.