Skip to content

Commit 4dc0830

Browse files
committed
chi2 tweak
1 parent 4399847 commit 4dc0830

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

.github/workflows/build_wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
os: [ macos-12, macos-13, flyci-macos-large-latest-m2, macos-14, ubuntu-latest, windows-latest ]
12+
os: [ macos-12, macos-13, macos-13-xlarge, macos-14, ubuntu-latest, windows-latest ]
1313

1414
steps:
1515
- uses: awvwgk/setup-fortran@main
@@ -34,7 +34,7 @@ jobs:
3434
run: python -m pip install cibuildwheel
3535

3636
- name: Build macos-13 wheels
37-
if: matrix.os == 'macos-13' || matrix.os == 'macos-13-xlarge' || matrix.os == 'flyci-macos-large-latest-m2'
37+
if: matrix.os == 'macos-13' || matrix.os == 'macos-13-xlarge'
3838
env:
3939
MACOSX_DEPLOYMENT_TARGET: 13
4040
CIBW_BUILD: cp311-*
@@ -134,7 +134,7 @@ jobs:
134134
runs-on: ${{ matrix.os }}
135135
strategy:
136136
matrix:
137-
os: [ macos-11, macos-12, macos-13, flyci-macos-large-latest-m2, macos-14, ubuntu-latest, windows-latest ]
137+
os: [ macos-12, macos-13, macos-13-xlarge, macos-14, ubuntu-latest, windows-latest ]
138138

139139
steps:
140140
- uses: actions/setup-python@v5

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
env:
2727
- PYPI_DIST="true"
2828
- if: branch !~ ^test.*
29-
name: "GCC10 + Python 3.10 anaconda"
29+
name: "GCC10 + Python anaconda"
3030
dist: focal
3131
addons:
3232
apt:
@@ -37,7 +37,7 @@ jobs:
3737
- CHANNEL="defaults"
3838
- PYDIST="ANACONDA"
3939
- FORTRAN="test"
40-
python: "3.10"
40+
language: minimal
4141
- name: "Jammy + Python 3.12"
4242
addons:
4343
apt:
@@ -63,13 +63,13 @@ jobs:
6363

6464
install:
6565
- if [[ "$PYDIST" == "ANACONDA" ]]; then
66-
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
66+
wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
6767
bash miniconda.sh -b -p $HOME/miniconda;
6868
export PATH="$HOME/miniconda/bin:$PATH";
6969
hash -r;
7070
conda config --set always_yes yes --set changeps1 no;
7171
conda info -a;
72-
conda create -q -n test-environment -c $CHANNEL python=$TRAVIS_PYTHON_VERSION numpy scipy sympy;
72+
conda create -q -n test-environment -c $CHANNEL numpy scipy sympy;
7373
source activate test-environment;
7474
fi
7575
- if [[ "$FORTRAN" == "test" ]]; then

fortran/MathUtils.f90

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,18 @@ function GetChiSquared(c_inv, Y, n) result(chi2)
638638
real(dl) ztemp, chi2
639639

640640
chi2 = 0
641-
!$OMP parallel do private(j,ztemp) reduction(+:chi2) schedule(static,16)
642-
do j = 1, n
643-
ztemp= dot_product(Y(j+1:n), c_inv(j+1:n, j))
644-
chi2=chi2+ (ztemp*2 +c_inv(j, j)*Y(j))*Y(j)
645-
end do
641+
if (n>=512) then
642+
!$OMP parallel do private(j,ztemp) reduction(+:chi2) schedule(static,16)
643+
do j = 1, n
644+
ztemp= dot_product(Y(j+1:n), c_inv(j+1:n, j))
645+
chi2=chi2+ (ztemp*2 +c_inv(j, j)*Y(j))*Y(j)
646+
end do
647+
else
648+
do j = 1, n
649+
ztemp= dot_product(Y(j+1:n), c_inv(j+1:n, j))
650+
chi2=chi2+ (ztemp*2 +c_inv(j, j)*Y(j))*Y(j)
651+
end do
652+
end if
646653

647654
end function GetChiSquared
648655

0 commit comments

Comments
 (0)