1
$\begingroup$

I'm in the need of running a lot of jobs in the IBM backends. If one likes to run in parallel two jobs (say, with two different parameters), I have seen in the Jobs webpage that sometimes the jobs are mixed. What I mean with this is that e.g. in the downloadable cvs file, row 3 belongs to job 1 and row 4 to job 2. To filter out every single cell in the cvs does not appear feasible.

Now, in qiskit, if I send a big job, this is partitioned into several chunks, something that job_set_foo.report(detailed=True) returns is:

Job set name: 2021-07-22T14:09:01.003237
      ID: XXXX-YYYY
    tags: []
...
Detail report:
  experiments: 0-74
    job index: 0
    job ID: ZZZ1
...

So suppose that my ID XXX-YYY contains 20 jobs ids ZZZx. Is there a way to, from directly the ID, retrieve as a list all the ZZZx's jobs ids?

*job_set_foo = job_manager.run(circuits, backend=backend, shots=2**13)

$\endgroup$
2
$\begingroup$

If all what you want is a list of all job IDs for the jobs in a job set:

job_set = job_manager.retrieve_job_set(job_set_id = 'XXX-YYY', provider = provider)
id_list = [ job.job_id() for job in job_set.jobs() ]
$\endgroup$
3
  • $\begingroup$ I had 14 jobs but the method you describe only gives me a list with 10 ids. Any idea what was going on? $\endgroup$ Jul 23 at 9:01
  • $\begingroup$ The code works for me with more than 14 jobs! Are you sure you are passing the right job set ID? $\endgroup$ Jul 23 at 10:33
  • $\begingroup$ Ah, that's weird. I ran another set of jobs and it appears now complete. Thanks for the snippet! $\endgroup$ Jul 23 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.