Skip to content

Commit

Permalink
BSOD is fixed when running RB and IRB
Browse files Browse the repository at this point in the history
BSOD stands for Blue Screen Of Death
  • Loading branch information
msamiotis committed Oct 28, 2024
1 parent 55ad9b6 commit b2f3985
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions pycqed/instrument_drivers/meta_instrument/HAL_Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
by 'git blame' makes little sense. See GIT tag 'release_v0.3' for the original file.
"""

import os
import numpy as np
import time
import logging
Expand Down Expand Up @@ -3354,7 +3355,7 @@ def send_rb_tasks(pool_):
# Using `with ...:` makes sure the other processes will be terminated
# avoid starting too mane processes,
# nr_processes = None will start as many as the PC can handle
nr_processes = None if recompile else 1
nr_processes = os.cpu_count() // 4 if recompile else 1
with multiprocessing.Pool(
nr_processes,
maxtasksperchild=cl_oql.maxtasksperchild # avoid RAM issues
Expand Down Expand Up @@ -3666,9 +3667,10 @@ def run_parallel_iRB(
if pool is None:
# Using `with ...:` makes sure the other processes will be terminated
# `maxtasksperchild` avoid RAM issues
nr_processes = os.cpu_count() // 4
if not maxtasksperchild:
maxtasksperchild = cl_oql.maxtasksperchild
with multiprocessing.Pool(maxtasksperchild=maxtasksperchild) as pool:
with multiprocessing.Pool(nr_processes, maxtasksperchild=maxtasksperchild) as pool:
run_parallel_iRB(recompile=recompile,
pool=pool,
rb_tasks_start=rb_tasks_start)
Expand Down Expand Up @@ -4024,7 +4026,7 @@ def send_rb_tasks(pool_):
# Using `with ...:` makes sure the other processes will be terminated
# avoid starting too mane processes,
# nr_processes = None will start as many as the PC can handle
nr_processes = None if recompile else 1
nr_processes = os.cpu_count() // 4 if recompile else 1
with multiprocessing.Pool(
nr_processes,
maxtasksperchild=cl_oql.maxtasksperchild # avoid RAM issues
Expand Down Expand Up @@ -4518,7 +4520,7 @@ def send_rb_tasks(pool_):
# Using `with ...:` makes sure the other processes will be terminated
# avoid starting too mane processes,
# nr_processes = None will start as many as the PC can handle
nr_processes = None if recompile else 1
nr_processes = os.cpu_count() // 4 if recompile else 1
with multiprocessing.Pool(
nr_processes,
maxtasksperchild=cl_oql.maxtasksperchild # avoid RAM issues
Expand Down Expand Up @@ -4690,7 +4692,7 @@ def send_rb_tasks(pool_):
# Using `with ...:` makes sure the other processes will be terminated
# avoid starting too mane processes,
# nr_processes = None will start as many as the PC can handle
nr_processes = None if recompile else 1
nr_processes = os.cpu_count() // 4 if recompile else 1
with multiprocessing.Pool(
nr_processes,
maxtasksperchild=cl_oql.maxtasksperchild # avoid RAM issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
by 'git blame' makes little sense. See GIT tag 'release_v0.3' for the original file.
"""

import os
import time
import logging
import numpy as np
Expand Down Expand Up @@ -6711,7 +6712,7 @@ def send_rb_tasks(pool_):
# Using `with ...:` makes sure the other processes will be terminated
# avoid starting too mane processes,
# nr_processes = None will start as many as the PC can handle
nr_processes = None if recompile else 1
nr_processes = os.cpu_count() // 2 if recompile else 1
with multiprocessing.Pool(nr_processes) as pool:
rb_tasks = send_rb_tasks(pool)
cl_oql.wait_for_rb_tasks(rb_tasks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
},
{
"name": "mw_1",
"qubits": [[], [5], [6], [4]],
"qubits": [[6], [5], [], [4]],
"signal_type": "mw",
"ref_instrument_definition": "zi-hdawg",
"ref_control_mode": "awg8-mw-direct-iq",
Expand Down

0 comments on commit b2f3985

Please sign in to comment.