Skip to content

Conversation

@ishansurdi
Copy link

Problem

os.sched_getaffinity() is a Linux-only function and causes AttributeError on Windows and macOS systems, preventing the script from running on these platforms.

Solution

Replace os.sched_getaffinity(0) with os.cpu_count() which is cross-platform and available on all operating systems.

Changes

  • Updated jackhmmer_n_cpu default value
  • Updated hmmsearch_n_cpu default value
  • Updated hhsearch_n_cpu default value

Testing

  • ✅ Tested on Windows - works correctly
  • ✅ Detects CPU count properly
  • ✅ Maintains same logic (min of cpu_count and 8)
  • ✅ Includes fallback to 8 if cpu_count() returns None

Compatibility

  • Works on: Linux, Windows, macOS
  • Python: 3.8+
  • No breaking changes

@google-cla
Copy link

google-cla bot commented Dec 24, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant