Skip to content

Commit 7a0e463

Browse files
Merge pull request #80 from EXP-code/testsuite
Checking continuous integration
2 parents 8c100f0 + 7758e86 commit 7a0e463

6 files changed

Lines changed: 52 additions & 213 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Test Builds"
1+
name: "Build and Test"
22

33
on:
44
push:
@@ -7,12 +7,13 @@ on:
77
pull_request:
88
branches:
99
- main
10+
- devel
1011
jobs:
11-
pyexp:
12+
exp:
1213
strategy:
1314
matrix:
1415
os: [ubuntu-latest]
15-
cc: [gcc, mpicc]
16+
cc: [gcc]
1617

1718
name: "Test pyEXP Build"
1819
runs-on: ${{ matrix.os }}
@@ -25,20 +26,21 @@ jobs:
2526
run: |
2627
sudo apt-get update
2728
sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev
29+
sudo pip install numpy
2830
2931
- name: Setup submodule and build
3032
run: |
3133
git submodule update --init --recursive
3234
mkdir -p build/install
3335
34-
- name: Compile pyEXP
36+
- name: Compile EXP
3537
if: runner.os == 'Linux'
3638
env:
3739
CC: ${{ matrix.cc }}
3840
working-directory: ./build
3941
run: >-
4042
cmake
41-
-DENABLE_NBODY=NO
43+
-DENABLE_NBODY=YES
4244
-DENABLE_PYEXP=YES
4345
-DCMAKE_BUILD_TYPE=Release
4446
-DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake
@@ -48,48 +50,12 @@ jobs:
4850
4951
- name: Make
5052
working-directory: ./build
51-
run: make -j 2
52-
53-
# -----------------------------------------------------------------------------------
54-
55-
exp:
56-
strategy:
57-
matrix:
58-
os: [ubuntu-latest]
59-
cc: [gcc, mpicc]
60-
61-
name: "Test Full EXP Build"
62-
runs-on: ${{ matrix.os }}
63-
steps:
64-
- name: Checkout
65-
uses: actions/checkout@v3
66-
67-
- name: Install core dependencies - ubuntu
68-
if: runner.os == 'Linux'
69-
run: |
70-
sudo apt-get update
71-
sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev
72-
73-
- name: Setup submodule and build
74-
run: |
75-
git submodule update --init --recursive
76-
mkdir -p build/install
77-
78-
- name: Compile Full EXP - Linux
79-
if: runner.os == 'Linux'
80-
env:
81-
CC: ${{ matrix.cc }}
82-
working-directory: ./build
83-
run: >-
84-
cmake
85-
-DENABLE_NBODY=YES
86-
-DENABLE_PYEXP=NO
87-
-DCMAKE_BUILD_TYPE=Release
88-
-DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake
89-
-DCMAKE_INSTALL_PREFIX=./install
90-
-Wno-dev
91-
..
53+
run: make -j 4
9254

93-
- name: Make
55+
- name: CTest Quick
9456
working-directory: ./build
95-
run: make -j 2
57+
run: ctest -L quick
58+
59+
#- name: CTest Long
60+
#working-directory: ./build
61+
#run: ctest -L long

.github/workflows/buildfull.yml

Lines changed: 0 additions & 146 deletions
This file was deleted.

tests/Cube/check.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
import numpy as np
1+
# open the output log file
2+
file = open("OUTLOG.runS")
23

3-
# Read the output log file
4-
data = np.loadtxt("OUTLOG.runS", skiprows=6, delimiter="|")
4+
n = 0 # Count lines
5+
mean = [0.0, 0.0, 0.0] # Mean positions
56

6-
# Columns 4, 5, 6 is mean position
7-
x = np.mean(data[:,3])
8-
y = np.mean(data[:,4])
9-
z = np.mean(data[:,5])
7+
# Open the output log file
8+
#
9+
while (line := file.readline()) != "":
10+
if n >= 6: # Skip the header stuff
11+
v = [float(x) for x in line.split('|')]
12+
mean[0] += v[3] # x pos
13+
mean[1] += v[4] # y pos
14+
mean[2] += v[5] # z pos
15+
n = n + 1 # Count lines
1016

11-
# If the values are close to 0.5, assume it worked
12-
if np.abs(x - 0.5) > 0.15 or np.abs(y - 0.5) > 0.15 or np.abs(z - 0.5) > 0.15:
17+
if n>6: # Sanity check
18+
for i in range(3):
19+
mean[i] = mean[i]/(n-6) - 0.5
20+
21+
# If the squared values are close to 0.0, assume it worked
22+
#
23+
if mean[0]*mean[0] > 0.03 or mean[1]*mean[1] > 0.03 or mean[2]*mean[2] > 0.03:
1324
exit(1)
1425
else:
1526
exit(0)

tests/Disk/cyl_basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# coding: utf-8
33

4-
import numpy as np
4+
# import numpy as np
55
import pyEXP
66

77
# Make the disk basis config

tests/Halo/check.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
import numpy as np
1+
# Open the output log file
2+
file = open("OUTLOG.run0")
23

3-
# Read the output log file
4-
data = np.loadtxt("OUTLOG.run0", skiprows=6, delimiter="|")
4+
n = 0 # Count lines
5+
mean = 0.0 # Accumulate 2T/VC values
56

6-
# Column 16 is -2T/VC. The mean should be 1
7-
mean = np.mean(data[:,16])
8-
stdv = np.std (data[:,16])
7+
# Open the output log file
8+
#
9+
while (line := file.readline()) != "":
10+
if n >= 6: # Skip the header stuff
11+
v = [float(x) for x in line.split('|')]
12+
mean += v[16] # This is the 2T/VC column
13+
n = n + 1 # Count lines
914

10-
# If the values are within 6 sigma of 1, assume that the simulation worked
11-
if np.abs(mean - 1.0) > 6.0*stdv:
15+
if n>6: mean /= n-6 # Sanity check
16+
17+
# Check closeness to 1.0
18+
#
19+
if (mean-1.0)*(mean-1.0) > 0.003:
1220
exit(1)
1321
else:
1422
exit(0)

tests/Halo/sph_basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# coding: utf-8
33

4-
import numpy as np
4+
# import numpy as np
55
import pyEXP
66

77
# Make the halo basis config

0 commit comments

Comments
 (0)