Skip to content
Closed
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
38 changes: 26 additions & 12 deletions .github/workflows/test-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Test AMUSE framework
on:
push:
branches:
- main
- issue-1144-new-continuous-integration
pull_request:
branches:
- main
- main
workflow_dispatch:

jobs:
Expand All @@ -18,7 +18,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- macos-latest
# - macos-latest

defaults:
run:
Expand All @@ -41,15 +41,27 @@ jobs:
run: |
conda install c-compiler cxx-compiler fortran-compiler 'gfortran<14' python pkgconfig coreutils patch curl tar unzip gzip bzip2 xz perl bison make cmake openmpi gsl fftw gmp mpfr hdf5 netcdf4 libopenblas liblapack zlib pip wheel 'docutils>=0.6' 'mpi4py>=1.1.0' 'numpy>=1.2.2' 'h5py>=1.1.0' pytest

# - name: Configure OpenMPI
# run: |
# mkdir -p "$HOME/.openmpi"
# echo "rmaps_base_oversubscribe = true" >>"$HOME/.openmpi/mca-params.conf"
# echo "mpi_yield_when_idle = true" >>"$HOME/.openmpi/mca-params.conf"
# echo "btl_tcp_if_include = lo,eth0" >>"$HOME/.openmpi/mca-params.conf"
# mkdir -p "$HOME/.prte"
# echo "rmaps_default_mapping_policy = :oversubscribe" >>"$HOME/.prte/mca-params.conf"
# echo "prte_if_include = lo,eth0" >>"$HOME/.prte/mca-params.conf"
- name: Configure OpenMPI
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
mkdir -p "$HOME/.openmpi"
# echo "rmaps_base_oversubscribe = true" >>"$HOME/.openmpi/mca-params.conf"
echo "mpi_yield_when_idle = true" >>"$HOME/.openmpi/mca-params.conf"
echo "mca_base_verbose = stdout,level:9" >> "$HOME/.openmpi/mca-params.conf"
echo "mpi_comm_verbose = 100" >> "$HOME/.openmpi/mca-params.conf"
echo "btl_base_verbose = 100" >> "$HOME/.openmpi/mca-params.conf"
echo "hwloc_base_verbose = 100" >> "$HOME/.openmpi/mca-params.conf"
echo "if_base_verbose = 100" >> "$HOME/.openmpi/mca-params.conf"
echo "pmix_base_verbose = 100" >> "$HOME/.openmpi/mca-params.conf"
# echo "btl_tcp_if_include = lo,eth0" >>"$HOME/.openmpi/mca-params.conf"
mkdir -p "$HOME/.prte"
echo "rmaps_default_mapping_policy = :oversubscribe" >>"$HOME/.prte/mca-params.conf"
echo "prte_if_include = lo,eth0" >>"$HOME/.prte/mca-params.conf"

- name: Test OpenMPI
run: |
mpicc -o $HOME/amuse/mpi_test $HOME/amuse/mpi_test.c
mpirun -n 1 $HOME/amuse/mpi_test

- name: Checkout
uses: actions/checkout@v4
Expand All @@ -75,10 +87,12 @@ jobs:
./setup test amuse-framework

- name: Save build logs
if: always()
run: |
tar czf logs-${{ matrix.os }}.tar.gz support/logs

- name: Archive build logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.os }}.tar.gz
Expand Down
17 changes: 17 additions & 0 deletions mpi_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <mpi.h>
#include <stdio.h>

int main(int argc, char **argv) {
int rank, size;

MPI_Init(&argc, &argv);

MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);

printf("%d of %d\n", size, rank);

MPI_Finalize();
return 0;
}

2 changes: 2 additions & 0 deletions src/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ artifacts = ["amuse/_version.py"]
pythonpath = ["tests/"]
testpaths = ["tests/"]

addopts = "-vv -s -x -k TestAsync"

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def setup_class(cls):
cls.exefile = str(Path(__file__).parent / 'async_worker')

def test1(self):
instance = ForTestingInterface(self.exefile)
instance = ForTestingInterface(
self.exefile, redirection="file",
redirect_stdout_file="async.out", redirect_stderr_file="async.err")
int_out, error = instance.echo_int(10)
instance.stop()
self.assertEqual(int_out, 10)
Expand Down
6 changes: 4 additions & 2 deletions support/setup/testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ test_framework() {
${GMAKE} -C src/tests all
# Tests for amuse.distributed won't be fixed as it is to be removed, disabled.
if [ "x${CI}" = "x" ] ; then
cd src/tests && pytest --import-mode=append core_tests compile_tests --ignore compile_tests/java_implementation -k 'not TestCDistributedImplementationInterface and not TestAsyncDistributed' ${PYTEST_OPTS}
# cd src/tests && pytest --import-mode=append core_tests compile_tests --ignore compile_tests/java_implementation -k 'not TestCDistributedImplementationInterface and not TestAsyncDistributed' ${PYTEST_OPTS}
cd src/tests && pytest --import-mode=append core_tests compile_tests --ignore compile_tests/java_implementation -k 'TestAsync and test1' ${PYTEST_OPTS}
else
cd src/tests && pytest --import-mode=append core_tests compile_tests --ignore compile_tests/java_implementation -k 'not TestCDistributedImplementationInterface and not TestAsyncDistributed and not noci' ${PYTEST_OPTS}
# cd src/tests && pytest --import-mode=append core_tests compile_tests --ignore compile_tests/java_implementation -k 'not TestCDistributedImplementationInterface and not TestAsyncDistributed and not noci' ${PYTEST_OPTS}
cd src/tests && pytest --import-mode=append core_tests compile_tests --ignore compile_tests/java_implementation -k 'TestAsync and test1 and not noci' ${PYTEST_OPTS}

fi

Expand Down
Loading