Add initial PsiBasin code #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |