From 2e89c5dd856bcbf0eb321c32bcb1657772850637 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Tue, 9 Jul 2024 07:38:50 -0700 Subject: [PATCH 01/11] Testing testing 1 2 3 --- .github/workflows/build.yml | 50 +++++-------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a37377ef8..acdf4f4d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: branches: - main jobs: - pyexp: + exp: strategy: matrix: os: [ubuntu-latest] @@ -31,14 +31,14 @@ jobs: git submodule update --init --recursive mkdir -p build/install - - name: Compile pyEXP + - name: Compile EXP if: runner.os == 'Linux' env: CC: ${{ matrix.cc }} working-directory: ./build run: >- cmake - -DENABLE_NBODY=NO + -DENABLE_NBODY=YES -DENABLE_PYEXP=YES -DCMAKE_BUILD_TYPE=Release -DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake @@ -50,46 +50,8 @@ jobs: working-directory: ./build run: make -j 2 - # ----------------------------------------------------------------------------------- - - exp: - strategy: - matrix: - os: [ubuntu-latest] - cc: [gcc, mpicc] - - name: "Test Full EXP Build" - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install core dependencies - ubuntu - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev - - - name: Setup submodule and build - run: | - git submodule update --init --recursive - mkdir -p build/install - - - name: Compile Full EXP - Linux - if: runner.os == 'Linux' - env: - CC: ${{ matrix.cc }} + - name: CTest working-directory: ./build - run: >- - cmake - -DENABLE_NBODY=YES - -DENABLE_PYEXP=NO - -DCMAKE_BUILD_TYPE=Release - -DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake - -DCMAKE_INSTALL_PREFIX=./install - -Wno-dev - .. + run: ctest -j 2 -L quick + - - name: Make - working-directory: ./build - run: make -j 2 From 93c48f285934b4fd5b633adb6b17a28318e4d877 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Tue, 9 Jul 2024 07:47:29 -0700 Subject: [PATCH 02/11] rm old build action [no ci] --- .github/workflows/buildfull.yml | 146 -------------------------------- 1 file changed, 146 deletions(-) delete mode 100644 .github/workflows/buildfull.yml diff --git a/.github/workflows/buildfull.yml b/.github/workflows/buildfull.yml deleted file mode 100644 index eb9c86552..000000000 --- a/.github/workflows/buildfull.yml +++ /dev/null @@ -1,146 +0,0 @@ -name: "Test Builds" - -on: - -jobs: - pyexp: - strategy: - matrix: - os: [macos-latest, ubuntu-latest] - cc: [gcc, mpicc] - - name: "Test pyEXP Build" - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install core dependencies - ubuntu - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev - - - name: Install core dependencies - mac - if: startsWith(matrix.os, 'mac') - run: | - brew update - brew reinstall gcc - brew install eigen fftw hdf5 open-mpi libomp - - - name: Setup submodule and build - run: | - git submodule update --init --recursive - mkdir -p build/install - - - name: Compile pyEXP - Linux - if: runner.os == 'Linux' - env: - CC: ${{ matrix.cc }} - working-directory: ./build - run: >- - cmake - -DENABLE_NBODY=NO - -DENABLE_PYEXP=YES - -DCMAKE_BUILD_TYPE=Release - -DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake - -DCMAKE_INSTALL_PREFIX=./install - -Wno-dev - .. - - # Note for future: The homebrew paths are for intel only. Once ARM macs are - # supported in here, we'll need to update to /opt/homebrew/... instead - - name: Compile pyEXP - Mac - if: startsWith(matrix.os, 'mac') - env: - CC: ${{ matrix.cc }} - LDFLAGS: -L/usr/local/opt/libomp/lib - CPPFLAGS: -I/usr/local/opt/libomp/include - working-directory: ./build - run: >- - cmake - -DENABLE_NBODY=NO - -DENABLE_PYEXP=YES - -DCMAKE_BUILD_TYPE=Release - -DEigen3_DIR=/usr/local/share/eigen3/cmake - -DCMAKE_INSTALL_PREFIX=./install - -DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include - -DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include - -Wno-dev - .. - - - name: Make - working-directory: ./build - run: make -j 2 - - # ----------------------------------------------------------------------------------- - - exp: - strategy: - matrix: - os: [macos-latest, ubuntu-latest] - cc: [gcc, mpicc] - - name: "Test Full EXP Build" - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install core dependencies - ubuntu - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev - - - name: Install core dependencies - mac - if: startsWith(matrix.os, 'mac') - run: | - brew update - brew reinstall gcc - brew install eigen fftw hdf5 open-mpi libomp - - - name: Setup submodule and build - run: | - git submodule update --init --recursive - mkdir -p build/install - - - name: Compile Full EXP - Linux - if: runner.os == 'Linux' - env: - CC: ${{ matrix.cc }} - working-directory: ./build - run: >- - cmake - -DENABLE_NBODY=YES - -DENABLE_PYEXP=NO - -DCMAKE_BUILD_TYPE=Release - -DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake - -DCMAKE_INSTALL_PREFIX=./install - -Wno-dev - .. - - # Note for future: The homebrew paths are for intel only. Once ARM macs are - # supported in here, we'll need to update to /opt/homebrew/... instead - - name: Compile Full EXP - Mac - if: startsWith(matrix.os, 'mac') - env: - CC: ${{ matrix.cc }} - LDFLAGS: -L/usr/local/opt/libomp/lib - CPPFLAGS: -I/usr/local/opt/libomp/include - working-directory: ./build - run: >- - cmake - -DENABLE_NBODY=YES - -DENABLE_PYEXP=NO - -DCMAKE_BUILD_TYPE=Release - -DEigen3_DIR=/usr/local/share/eigen3/cmake - -DCMAKE_INSTALL_PREFIX=./install - -DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include - -DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include - -Wno-dev - .. - - - name: Make - working-directory: ./build - run: make -j 2 From 824a13e1f15be8d37257d60b453ccd904f9c8eca Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Tue, 9 Jul 2024 10:35:02 -0700 Subject: [PATCH 03/11] updates to ctest suite --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acdf4f4d2..a6514ca58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - cc: [gcc, mpicc] + cc: [gcc] name: "Test pyEXP Build" runs-on: ${{ matrix.os }} From 68ed00e81a5a183ac9b48090b17f7ea145b2754d Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Tue, 9 Jul 2024 16:49:30 -0700 Subject: [PATCH 04/11] numpy dependence tweaks --- .github/workflows/build.yml | 1 + tests/Disk/cyl_basis.py | 1 - tests/Halo/sph_basis.py | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6514ca58..b966d0d4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev + sudo pip install numpy - name: Setup submodule and build run: | diff --git a/tests/Disk/cyl_basis.py b/tests/Disk/cyl_basis.py index 227b22f4a..c3c55b4e4 100644 --- a/tests/Disk/cyl_basis.py +++ b/tests/Disk/cyl_basis.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # coding: utf-8 -import numpy as np import pyEXP # Make the disk basis config diff --git a/tests/Halo/sph_basis.py b/tests/Halo/sph_basis.py index 1cee5d8ac..f7b6a18b9 100644 --- a/tests/Halo/sph_basis.py +++ b/tests/Halo/sph_basis.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # coding: utf-8 -import numpy as np import pyEXP # Make the halo basis config From 7ffd4b8554a0d8ef204bfaa208cdf2423c49469a Mon Sep 17 00:00:00 2001 From: mdw Date: Tue, 9 Jul 2024 20:34:01 -0400 Subject: [PATCH 05/11] Fixes to remove numpy --- tests/Disk/cyl_basis.py | 2 +- tests/Halo/check.py | 22 ++++++++++++++-------- tests/Halo/sph_basis.py | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tests/Disk/cyl_basis.py b/tests/Disk/cyl_basis.py index 227b22f4a..2d2b6e0d3 100644 --- a/tests/Disk/cyl_basis.py +++ b/tests/Disk/cyl_basis.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding: utf-8 -import numpy as np +# import numpy as np import pyEXP # Make the disk basis config diff --git a/tests/Halo/check.py b/tests/Halo/check.py index 54a499349..f181081d9 100644 --- a/tests/Halo/check.py +++ b/tests/Halo/check.py @@ -1,14 +1,20 @@ -import numpy as np +# Open the output log file +file = open("OUTLOG.run0") -# Read the output log file -data = np.loadtxt("OUTLOG.run0", skiprows=6, delimiter="|") +n = 0 # Count lines +mean = 0.0 # Accumulate 2T/VC valkues -# Column 16 is -2T/VC. The mean should be 1 -mean = np.mean(data[:,16]) -stdv = np.std (data[:,16]) +# Open the output log file +while (line := file.readline()) != "": + if n >= 6: # Skip the header stuff + v = [float(x) for x in line.split('|')] + mean += v[16] # This is the 2T/VC column + n = n + 1 # Count lines -# If the values are within 6 sigma of 1, assume that the simulation worked -if np.abs(mean - 1.0) > 6.0*stdv: +if n>6: mean /= n-6 # Sanity check + +# Check closeness to 1.0 +if (mean-1.0)*(mean-1.0) > 0.003: exit(1) else: exit(0) diff --git a/tests/Halo/sph_basis.py b/tests/Halo/sph_basis.py index 1cee5d8ac..e72ca54e5 100644 --- a/tests/Halo/sph_basis.py +++ b/tests/Halo/sph_basis.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding: utf-8 -import numpy as np +# import numpy as np import pyEXP # Make the halo basis config From 0de5e0d3a27031cfdb48697eaeb32d5c33a3e67b Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Tue, 9 Jul 2024 19:10:19 -0700 Subject: [PATCH 06/11] Fix comment spelling typo [no ci] --- tests/Halo/check.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Halo/check.py b/tests/Halo/check.py index f181081d9..d05381c3d 100644 --- a/tests/Halo/check.py +++ b/tests/Halo/check.py @@ -2,9 +2,10 @@ file = open("OUTLOG.run0") n = 0 # Count lines -mean = 0.0 # Accumulate 2T/VC valkues +mean = 0.0 # Accumulate 2T/VC values # Open the output log file +# while (line := file.readline()) != "": if n >= 6: # Skip the header stuff v = [float(x) for x in line.split('|')] @@ -14,6 +15,7 @@ if n>6: mean /= n-6 # Sanity check # Check closeness to 1.0 +# if (mean-1.0)*(mean-1.0) > 0.003: exit(1) else: From af674567bd8705123bbc01a1620a46610b368de8 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Tue, 9 Jul 2024 20:22:27 -0700 Subject: [PATCH 07/11] adjustments to build action --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b966d0d4a..82c76f90e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - main + - devel jobs: exp: strategy: @@ -49,10 +50,12 @@ jobs: - name: Make working-directory: ./build - run: make -j 2 + run: make -j 4 - - name: CTest + - name: CTest Quick working-directory: ./build - run: ctest -j 2 -L quick + run: ctest -j 4 -L quick - + - name: CTest Long + working-directory: ./build + run: ctest -j 4 -L long From 65dd03aabe4e38a1b2f6cc152cf9fa9f488c185f Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Tue, 9 Jul 2024 21:05:25 -0700 Subject: [PATCH 08/11] Remove numpy dependence from Cube OUTLOG check [no ci] --- tests/Cube/check.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/tests/Cube/check.py b/tests/Cube/check.py index 1956e0ee6..b6b0a3eef 100644 --- a/tests/Cube/check.py +++ b/tests/Cube/check.py @@ -1,15 +1,26 @@ -import numpy as np +# open the output log file +file = open("OUTLOG.runS") -# Read the output log file -data = np.loadtxt("OUTLOG.runS", skiprows=6, delimiter="|") +n = 0 # Count lines +mean = [0.0, 0.0, 0.0] # Mean positions -# Columns 4, 5, 6 is mean position -x = np.mean(data[:,3]) -y = np.mean(data[:,4]) -z = np.mean(data[:,5]) +# Open the output log file +# +while (line := file.readline()) != "": + if n >= 6: # Skip the header stuff + v = [float(x) for x in line.split('|')] + mean[0] += v[3] # x pos + mean[1] += v[4] # y pos + mean[2] += v[5] # z pos + n = n + 1 # Count lines -# If the values are close to 0.5, assume it worked -if np.abs(x - 0.5) > 0.15 or np.abs(y - 0.5) > 0.15 or np.abs(z - 0.5) > 0.15: +if n>6: # Sanity check + for i in range(3): + mean[i] = mean[i]/(n-6) - 0.5 + +# If the squared values are close to 0.0, assume it worked +# +if mean[0]*mean[0] > 0.03 or mean[1]*mean[1] > 0.03 or mean[2]*mean[2] > 0.03: exit(1) else: exit(0) From 2a42b53dace10c0532fbf9ca9d6453f0d63e91e5 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Wed, 10 Jul 2024 07:13:40 -0700 Subject: [PATCH 09/11] Disable long tests for actions --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82c76f90e..71dfb58ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,6 +56,6 @@ jobs: working-directory: ./build run: ctest -j 4 -L quick - - name: CTest Long - working-directory: ./build - run: ctest -j 4 -L long + #- name: CTest Long + #working-directory: ./build + #run: ctest -j 4 -L long From 4572df803227c43af29b46460a7d2ae3a5b80166 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Wed, 10 Jul 2024 11:36:06 -0700 Subject: [PATCH 10/11] Rename runner --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71dfb58ba..bfad99340 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: "Test Builds" +name: "Build and Test" on: push: From 7758e867268bcd5fbad5ea5cc0db9ad60c29d6c0 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Wed, 10 Jul 2024 11:55:53 -0700 Subject: [PATCH 11/11] run tests in serial [no ci] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfad99340..b9ddde223 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,8 +54,8 @@ jobs: - name: CTest Quick working-directory: ./build - run: ctest -j 4 -L quick + run: ctest -L quick #- name: CTest Long #working-directory: ./build - #run: ctest -j 4 -L long + #run: ctest -L long