MolecularAI / Chemformer

Apache License 2.0
211 stars 36 forks source link

replaced `len(os.sched_getaffinity(0))` to `os.cpu_count()` works on Windows/OSX/Linux systems. #14

Closed salman-moh closed 1 year ago

salman-moh commented 2 years ago

These changes are to prevent: AttributeError: module 'os' has no attribute 'sched_getaffinity'

SGenheden commented 1 year ago

This PR contains more changes than advertised from the title. Please only submit one change per PR

SGenheden commented 1 year ago

os.cpu_count() does not give the correct result on Linux systems.

salman-moh commented 1 year ago

Sorry I'll remove the other changes, keeping only the os.cpu_count() - this is returning me the same value as the len(os.sched_getaffinity(0)), what exactly is the incorrect result ?

salman-moh commented 1 year ago

@SGenheden please let me know, because I printed out both in my Linux machine and they return the same.