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

Job executing problem on RBPi with Raspbian Stretch in _parallel.py #1212

Closed
Tomev opened this issue Nov 4, 2018 · 3 comments
Closed

Job executing problem on RBPi with Raspbian Stretch in _parallel.py #1212

Tomev opened this issue Nov 4, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@Tomev
Copy link

Tomev commented Nov 4, 2018

Informations

  • Qiskit Terra version: 0.6.1
  • Python version: 3.6
  • Operating system: Raspbian Stretch

What is the current behavior?

When trying to execute job on my Raspberry Pi B I get following error in _parallel.py:

"... _parallel.py", line 109, in parallel_map
if platform.system() != 'Windows' and num_processes > 1
TypeError: '>' not supported between instances of 'NoneType' and 'int'

From what I understand initialization of num_processes (or rather it's default value - CPU_COUNT = local_hardware_info()['cpus']) is a problem on selected os.

Steps to reproduce the problem

Try to execute a job on Raspbian Stretch on RBPi.

What is the expected behavior?

The job gets executed.

Suggested solutions

Check if num_processes is an initialized int before comparison.

@nonhermitian
Copy link
Contributor

It seems that psutil cannot determine the physical cpu count on your system. The solution is to probably fall back to num_processes=1 if it cannot be determined

@charlesastaylor
Copy link
Contributor

I can make this fix I think.

Checking psutil.cpu_count on my pi I noticed that cpu_count(logical=False) returns None but cpu_count(logical=True) returns 4. Is it worth trying value of logical=True when logical=False returns None or just default straight to 1?

@mtreinish
Copy link
Member

Opened an upstream issue in psutil for this: giampaolo/psutil#1359

@1ucian0 1ucian0 added the bug Something isn't working label Nov 6, 2018
charlesastaylor added a commit to charlesastaylor/qiskit-terra that referenced this issue Nov 7, 2018
*Fallback to 1 when cpu_count returns None

*Create test_util.py and add test

Fixes Qiskit#1212
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this issue Jul 30, 2019
…skit#1214)

*Fallback to 1 when cpu_count returns None

*Create test_util.py and add test

Fixes Qiskit#1212
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants