diff --git a/.github/workflows/osx.yaml b/.github/workflows/osx.yaml new file mode 100644 index 0000000000..0035faa228 --- /dev/null +++ b/.github/workflows/osx.yaml @@ -0,0 +1,72 @@ +name: Parsl + +on: + pull_request: + types: + - opened + - synchronize + +jobs: + main-test-suite: + strategy: + fail-fast: false + matrix: + os: [macos-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + + steps: + - uses: actions/checkout@master + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Collect Job Information + id: job-info + run: | + echo "Python Version: ${{ matrix.python-version }}" >> ci_job_info.txt + echo "CI Triggering Event: ${{ github.event_name }}" >> ci_job_info.txt + echo "Triggering Git Ref: ${{ github.ref }}" >> ci_job_info.txt + echo "Triggering Git SHA: ${{ github.sha }}" >> ci_job_info.txt + echo "Workflow Run: ${{ github.run_number }}" >> ci_job_info.txt + echo "Workflow Attempt: ${{ github.run_attempt }}" >> ci_job_info.txt + as_ascii="$(echo "${{ github.ref_name }}" | perl -pe "s/[^A-z0-9-]+/-/g; s/^-+|-+\$//g; s/--+/-/g;")" + echo "as-ascii=$as_ascii" >> $GITHUB_OUTPUT + + - name: Non-requirements based install + run: | + brew install mpich + + - name: setup virtual env + run: | + python -m venv .venv + source .venv/bin/activate + + - name: Install Parsl and dependencies + run: | + source .venv/bin/activate + pip install -r requirements.txt + pip install -r test-requirements.txt + + - name: make test + run: | + source .venv/bin/activate + export PARSL_TEST_PRESERVE_NUM_RUNS=7 + make test + + - name: Documentation checks + run: | + source .venv/bin/activate + pip install .[docs] + brew install pandoc + cd docs + test ! -e stubs + PYTHONPATH=/tmp/cctools/lib/python3.8/site-packages make SPHINXOPTS=-W html + cd .. + ! grep ERROR .pytest/parsltest-current/runinfo*/*/database_manager.log + ! grep ERROR .pytest/parsltest-current/runinfo*/*/monitoring_router.log + rm -f .pytest/parsltest-current test_runinfo + \ No newline at end of file diff --git a/parsl/executors/high_throughput/process_worker_pool.py b/parsl/executors/high_throughput/process_worker_pool.py index 0a2bc513dd..574c694ae0 100755 --- a/parsl/executors/high_throughput/process_worker_pool.py +++ b/parsl/executors/high_throughput/process_worker_pool.py @@ -675,9 +675,10 @@ def worker( # If desired, set process affinity if cpu_affinity != "none": # Count the number of cores per worker - avail_cores = sorted(os.sched_getaffinity(0)) # Get the available threads - cores_per_worker = len(avail_cores) // pool_size - assert cores_per_worker > 0, "Affinity does not work if there are more workers than cores" + if platform.system() == "Linux": + avail_cores = sorted(os.sched_getaffinity(0)) # Get the available threads + cores_per_worker = len(avail_cores) // pool_size + assert cores_per_worker > 0, "Affinity does not work if there are more workers than cores" # Determine this worker's cores if cpu_affinity == "block":