Skip to content

Commit

Permalink
chi2 tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Aug 18, 2024
1 parent 4399847 commit 4dc0830
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-12, macos-13, flyci-macos-large-latest-m2, macos-14, ubuntu-latest, windows-latest ]
os: [ macos-12, macos-13, macos-13-xlarge, macos-14, ubuntu-latest, windows-latest ]

steps:
- uses: awvwgk/setup-fortran@main
Expand All @@ -34,7 +34,7 @@ jobs:
run: python -m pip install cibuildwheel

- name: Build macos-13 wheels
if: matrix.os == 'macos-13' || matrix.os == 'macos-13-xlarge' || matrix.os == 'flyci-macos-large-latest-m2'
if: matrix.os == 'macos-13' || matrix.os == 'macos-13-xlarge'
env:
MACOSX_DEPLOYMENT_TARGET: 13
CIBW_BUILD: cp311-*
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-11, macos-12, macos-13, flyci-macos-large-latest-m2, macos-14, ubuntu-latest, windows-latest ]
os: [ macos-12, macos-13, macos-13-xlarge, macos-14, ubuntu-latest, windows-latest ]

steps:
- uses: actions/setup-python@v5
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
env:
- PYPI_DIST="true"
- if: branch !~ ^test.*
name: "GCC10 + Python 3.10 anaconda"
name: "GCC10 + Python anaconda"
dist: focal
addons:
apt:
Expand All @@ -37,7 +37,7 @@ jobs:
- CHANNEL="defaults"
- PYDIST="ANACONDA"
- FORTRAN="test"
python: "3.10"
language: minimal
- name: "Jammy + Python 3.12"
addons:
apt:
Expand All @@ -63,13 +63,13 @@ jobs:

install:
- if [[ "$PYDIST" == "ANACONDA" ]]; then
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda info -a;
conda create -q -n test-environment -c $CHANNEL python=$TRAVIS_PYTHON_VERSION numpy scipy sympy;
conda create -q -n test-environment -c $CHANNEL numpy scipy sympy;
source activate test-environment;
fi
- if [[ "$FORTRAN" == "test" ]]; then
Expand Down
17 changes: 12 additions & 5 deletions fortran/MathUtils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,18 @@ function GetChiSquared(c_inv, Y, n) result(chi2)
real(dl) ztemp, chi2

chi2 = 0
!$OMP parallel do private(j,ztemp) reduction(+:chi2) schedule(static,16)
do j = 1, n
ztemp= dot_product(Y(j+1:n), c_inv(j+1:n, j))
chi2=chi2+ (ztemp*2 +c_inv(j, j)*Y(j))*Y(j)
end do
if (n>=512) then
!$OMP parallel do private(j,ztemp) reduction(+:chi2) schedule(static,16)
do j = 1, n
ztemp= dot_product(Y(j+1:n), c_inv(j+1:n, j))
chi2=chi2+ (ztemp*2 +c_inv(j, j)*Y(j))*Y(j)
end do
else
do j = 1, n
ztemp= dot_product(Y(j+1:n), c_inv(j+1:n, j))
chi2=chi2+ (ztemp*2 +c_inv(j, j)*Y(j))*Y(j)
end do
end if

end function GetChiSquared

Expand Down

0 comments on commit 4dc0830

Please sign in to comment.