fix wrong string format and only show chunking info if the jobs are submitted to remote backend
@@ -72,14 +72,15 @@ def run_circuits(circuits, backend, execute_config, qjob_config={},
jobs.append(job)
qobjs.append(qobj)
- logger.info("There are {} circuits and they are chunked into"
- "{} chunks, each with {} circutis.".format(len(circuits), chunks, max_circuits_per_job))
-
if logger.isEnabledFor(logging.DEBUG) and show_circuit_summary:
logger.debug(summarize_circuits(circuits))
results = []
if with_autorecover:
+
+ logger.info("There are {} circuits and they are chunked into "
+ "{} chunks, each with {} circutis.".format(len(circuits), chunks, max_circuits_per_job))
+
for idx in range(len(jobs)):
job = jobs[idx]
job_id = job.id()
@@ -99,7 +100,7 @@ def run_circuits(circuits, backend, execute_config, qjob_config={},
"Terra job error: {} ".format(idx, job_id, e))
except Exception as e:
# if terra raise any error, which means something wrong, re-run it
- raise AlgorithmError("FAILURE: the {}-th chunk of circuits, job id: {}"
+ raise AlgorithmError("FAILURE: the {}-th chunk of circuits, job id: {}, "
"Terra unknown error: {} ".format(idx, job_id, e)) from e
# keep querying the status until it is okay.
