Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 14 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test Builds"
name: "Build and Test"

on:
push:
Expand All @@ -7,12 +7,13 @@ on:
pull_request:
branches:
- main
- devel
jobs:
pyexp:
exp:
strategy:
matrix:
os: [ubuntu-latest]
cc: [gcc, mpicc]
cc: [gcc]

name: "Test pyEXP Build"
runs-on: ${{ matrix.os }}
Expand All @@ -25,20 +26,21 @@ 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: |
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
Expand All @@ -48,48 +50,12 @@ jobs:

- name: Make
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 }}
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: make -j 4

- name: Make
- name: CTest Quick
working-directory: ./build
run: make -j 2
run: ctest -L quick

#- name: CTest Long
#working-directory: ./build
#run: ctest -L long
146 changes: 0 additions & 146 deletions .github/workflows/buildfull.yml

This file was deleted.

29 changes: 20 additions & 9 deletions tests/Cube/check.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion tests/Disk/cyl_basis.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 16 additions & 8 deletions tests/Halo/check.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
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 values

# 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)
2 changes: 1 addition & 1 deletion tests/Halo/sph_basis.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down