From bd5f2935cc824f017c01eebacefa5e523318eaf7 Mon Sep 17 00:00:00 2001 From: Matthew Carbone Date: Tue, 21 Nov 2023 11:20:02 -0500 Subject: [PATCH] Modify build tests, remove other tests for now --- .github/workflows/{build.yml => build.yaml} | 29 ++++----- .github/workflows/tests.yml | 69 --------------------- README.md | 2 +- 3 files changed, 14 insertions(+), 86 deletions(-) rename .github/workflows/{build.yml => build.yaml} (73%) delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yaml similarity index 73% rename from .github/workflows/build.yml rename to .github/workflows/build.yaml index 8ff4ec1..f3de71d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yaml @@ -15,6 +15,7 @@ jobs: matrix: mpi: ['mpich', 'openmpi'] os: ['ubuntu-latest', 'macos-latest'] + precision: [128, 256, 4096, 16384] name: ${{ matrix.os }} ${{ matrix.mpi }} runs-on: ${{ matrix.os }} @@ -30,19 +31,9 @@ jobs: with: mpi: ${{ matrix.mpi }} - - name: set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: install python dependencies - run: | - pip install numpy - pip install scipy - - name: build run: | - cmake -S . -B build -DPRECISON=256 -DBUILD_TESTS=ON -DSMOKE=OFF + cmake -S . -B build -DPRECISON=${{ matrix.precision }} -DBUILD_TESTS=ON -DSMOKE=OFF cd build make cd .. @@ -53,11 +44,17 @@ jobs: - name: test executables run: | - mpiexec -n 2 ./build/hdspin -t 6 -N 128 -l EREM -b 2.4 -d gillespie --seed=123 - rm -r data grids - mpiexec -n 2 ./build/hdspin -t 6 -N 128 -l EREM -b 2.2 -d standard --seed=123 - rm -r data grids - mpiexec -n 2 ./build/hdspin -t 6 -N 128 -l EREM -b 2.3 --seed=123 + mpiexec -n 5 ./build/hdspin -t 6 -N ${{ matrix.precision }} -l EREM -b 2.4 --seed=123 + + - name: set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: install python dependencies + run: | + pip install numpy + pip install scipy - name: run postprocess run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index cf4a498..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: tests - -on: - pull_request: - branches: ['master'] - push: - branches: ['master'] - tags: ["v*"] - -jobs: - - tests: - - strategy: - matrix: - beta: [2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0] - - name: beta=${{ matrix.beta }} - runs-on: ubuntu-latest - - steps: - - name: checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: install MPI - uses: mpi4py/setup-mpi@v1 - with: - mpi: openmpi - - - name: set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: install python dependencies - run: | - pip install numpy - pip install scipy - - - name: build - run: | - cmake -S . -B build -DPRECISON=256 -DBUILD_TESTS=ON -DSMOKE=OFF - cd build - make - cd .. - - - name: create and run the Gillespie simulation - run: | - mkdir ${{ matrix.beta }}-g - cd ${{ matrix.beta }}-g - mpiexec -n 5 ../build/hdspin -t 6 -N 24 -l EREM -b ${{ matrix.beta }} -d gillespie --seed=123 - python3 ../postprocess.py - cd .. - - - name: create and run the standard simulation - run: | - mkdir ${{ matrix.beta }}-s - cd ${{ matrix.beta }}-s - mpiexec -n 5 ../build/hdspin -t 6 -N 24 -l EREM -b ${{ matrix.beta }} -d standard --seed=123 - python3 ../postprocess.py - cd .. - - - name: assert they produced the same results - run: | - python3 tests/test_final.py compare -d1 ${{ matrix.beta }}-s -d2 ${{ matrix.beta }}-g --scale=1.0 --threshold=0.95 -f energy.txt energy_IS.txt - python3 tests/test_final.py compare -d1 ${{ matrix.beta }}-s -d2 ${{ matrix.beta }}-g --scale=1.0 --threshold=0.8 --take-last-prop=0.5 -f ridge_E.txt - diff --git a/README.md b/README.md index 4cd0248..bc07da8 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # hdspin [![image](https://github.com/matthewcarbone/hdspin/actions/workflows/build.yml/badge.svg)](https://github.com/matthewcarbone/hdspin/actions/workflows/build.yml) -[![image](https://github.com/matthewcarbone/hdspin/actions/workflows/tests.yml/badge.svg)](https://github.com/matthewcarbone/hdspin/actions/workflows/tests.yml) + **Sandbox for the Exponential and Gaussian Random Energy Models**