Skip to content

Commit

Permalink
pybamm-team#3646 Use os.cpu_count rather than processor affinity
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Jan 6, 2024
1 parent 9017c21 commit 632bcec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
id: get_num_cores
shell: python
run: |
from os import environ, sched_getaffinity
num_cpus = len(sched_getaffinity(0))
from os import environ, cpu_count
num_cpus = cpu_count()
output_file = environ['GITHUB_OUTPUT']
with open(output_file, "a", encoding="utf-8") as output_stream:
output_stream.write(f"count={num_cpus}\n")
Expand Down Expand Up @@ -80,9 +80,9 @@ jobs:
VCPKG_DEFAULT_TRIPLET=x64-windows-static-md
VCPKG_FEATURE_FLAGS=manifests,registries
CMAKE_GENERATOR="Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM=x64'
CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.get_num_cores.outputs.num_cpus }}
CIBW_ARCHS: "AMD64"
CMAKE_GENERATOR_PLATFORM=x64
CMAKE_BUILD_PARALLEL_LEVEL=${{ steps.get_num_cores.outputs.count }}
CIBW_ARCHS: AMD64
CIBW_BEFORE_BUILD: python -m pip install setuptools wheel # skip CasADi and CMake
CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()"

Expand Down

0 comments on commit 632bcec

Please sign in to comment.