Skip to content

Commit

Permalink
Merge branch 'amusecode:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rieder authored Dec 11, 2023
2 parents 7c1a13a + 47af808 commit e99310e
Show file tree
Hide file tree
Showing 324 changed files with 25,511 additions and 24,339 deletions.
67 changes: 54 additions & 13 deletions .github/workflows/inplace.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,104 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: inplace
name: ci

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
mpi: [ 'mpich', 'openmpi']
name: Test AMUSE with ${{ matrix.mpi }}
mpi:
- mpich
- openmpi
os:
- ubuntu-22.04
- ubuntu-20.04
# macOS is not ready yet - needs other setup of prerequisites
# - macos-12
# - macos-11
python:
- 3.7

steps:
- uses: actions/checkout@v3

- name: Checkout
uses: actions/checkout@v3

- name: Setup MPI
id: setup-mpi
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}

- name: Show MPI name
run: echo "${{ steps.setup-mpi.outputs.mpi }}"

- name: Show MPI info
run: mpichversion
if: ${{ matrix.mpi == 'mpich' }}

- name: Show MPI info
run: ompi_info
if: ${{ matrix.mpi == 'openmpi' }}

- name: Set up JDK 1.8
uses: actions/setup-java@v3.9.0
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
- name: Set up Python 3.8

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: ${{ matrix.python }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get install gfortran libopenblas-dev libhdf5-openmpi-dev libgsl0-dev cmake libfftw3-3 libfftw3-dev libmpfr6 libmpfr-dev
pip install numpy scipy matplotlib docutils mpi4py pytest pytest-timeout
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install amuse
run: |
pip install -e .
./configure
- name: build AMUSE framework
run: |
make framework
- name: build SSE and BHTree
run: |
make sse.code bhtree.code
- name: check installation
run: |
amusifier --get-amuse-configmk
pip list
- name: archive build log
uses: actions/upload-artifact@v3.1.1
with:
name: buildlog
path: build.log

- name: test core_tests
run: |
pytest --pyargs amuse.test.suite.core_tests -s
- name: test compile_tests
run: |
ip link show
Expand All @@ -67,10 +107,11 @@ jobs:
env:
OMPI_MCA_rmaps_base_oversubscribe: 1
OMPI_MCA_btl_tcp_if_include: lo

- name: test code_tests
run: |
pytest --pyargs amuse.test.suite.codes_tests.test_bhtree -sv
pytest --pyargs amuse.test.suite.codes_tests.test_sse -sv
mpiexec -n 1 pytest --pyargs amuse.test.suite.codes_tests.test_bhtree -sv
mpiexec -n 1 pytest --pyargs amuse.test.suite.codes_tests.test_sse -sv
env:
OMPI_MCA_rmaps_base_oversubscribe: 1
OMPI_MCA_btl_tcp_if_include: lo
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -30,7 +27,7 @@ jobs:
python -m pip install flake8 pytest
# don't install requirements.txt as mpi4py will fail...
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install setuptools setuptools_scm wheel docutils numpy h5py
python -m pip install --upgrade setuptools setuptools_scm wheel docutils numpy h5py
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -43,6 +40,6 @@ jobs:
- name: Test with pytest (only core tests)
run: |
pytest src/amuse/test/suite/core_tests
- name: Create packages
run: |
cd packages && sh generate_packages.sh
# - name: Create packages
# run: |
# cd packages && sh generate_packages.sh
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,16 @@ test_python_sockets_implementation

.idea

src/amuse/community/petar/src
src/amuse/community/bonsai2/src
src/amuse/community/*/version.py
src/amuse/version.py
doc/interactive_tutorial/_version.py
src/amuse/test/suite/_version.py
src/amuse/community/*/_version.py
src/amuse/_version.py
src/amuse/community/petar/src
src/amuse/community/petar/interface.cc
src/amuse/community/petar/interface.h
src/amuse/community/seba/src
packages/amuse*/dist
packages/dist
src/amuse/community/phantom/src

# standard directory for a virtualenv
env/
42 changes: 27 additions & 15 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for amuse 2023.3.1.dev41+gaa14f8bf8.d20230322.
# Generated by GNU Autoconf 2.71 for amuse 2023.7.0.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
Expand Down Expand Up @@ -668,8 +668,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='amuse'
PACKAGE_TARNAME='amuse'
PACKAGE_VERSION='2023.3.1.dev41+gaa14f8bf8.d20230322'
PACKAGE_STRING='amuse 2023.3.1.dev41+gaa14f8bf8.d20230322'
PACKAGE_VERSION='2023.7.0'
PACKAGE_STRING='amuse 2023.7.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1505,7 +1505,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures amuse 2023.3.1.dev41+gaa14f8bf8.d20230322 to adapt to many kinds of systems.
\`configure' configures amuse 2023.7.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1571,7 +1571,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of amuse 2023.3.1.dev41+gaa14f8bf8.d20230322:";;
short | recursive ) echo "Configuration of amuse 2023.7.0:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1725,7 +1725,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
amuse configure 2023.3.1.dev41+gaa14f8bf8.d20230322
amuse configure 2023.7.0
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2259,7 +2259,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by amuse $as_me 2023.3.1.dev41+gaa14f8bf8.d20230322, which was
It was created by amuse $as_me 2023.7.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -4942,13 +4942,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu

if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.5" >&5
printf %s "checking whether $PYTHON version is >= 3.5... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.7" >&5
printf %s "checking whether $PYTHON version is >= 3.7... " >&6; }
prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
# map returns an iterator in Python 3.0 and a list in 2.x
minver = list(map(int, '3.5'.split('.'))) + [0, 0, 0]
minver = list(map(int, '3.7'.split('.'))) + [0, 0, 0]
minverhex = 0
# xrange is not present in Python 3.0 and range returns an iterator
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
Expand All @@ -4970,8 +4970,8 @@ fi
else
# Otherwise, try each interpreter until we find one that satisfies
# VERSION.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.5" >&5
printf %s "checking for a Python interpreter with version >= 3.5... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.7" >&5
printf %s "checking for a Python interpreter with version >= 3.7... " >&6; }
if test ${am_cv_pathless_PYTHON+y}
then :
printf %s "(cached) " >&6
Expand All @@ -4983,7 +4983,7 @@ else $as_nop
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
# map returns an iterator in Python 3.0 and a list in 2.x
minver = list(map(int, '3.5'.split('.'))) + [0, 0, 0]
minver = list(map(int, '3.7'.split('.'))) + [0, 0, 0]
minverhex = 0
# xrange is not present in Python 3.0 and range returns an iterator
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
Expand Down Expand Up @@ -7776,7 +7776,13 @@ else $as_nop
fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
ifelse(main, main, , # Avoid conflicting decl of main.
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char main();
)
int
main (void)
{
Expand Down Expand Up @@ -7860,7 +7866,13 @@ else $as_nop
fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
ifelse(main, main, , # Avoid conflicting decl of main.
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char main();
)
int
main (void)
{
Expand Down Expand Up @@ -14322,7 +14334,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by amuse $as_me 2023.3.1.dev41+gaa14f8bf8.d20230322, which was
This file was extended by amuse $as_me 2023.7.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -14377,7 +14389,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
amuse config.status 2023.3.1.dev41+gaa14f8bf8.d20230322
amuse config.status 2023.7.0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AC_ARG_VAR([PYTHON], [Python interpreter])

AC_SUBST(FC_ISO_C_BINDINGS)

AM_PATH_PYTHON([3.5])
AM_PATH_PYTHON([3.7])

AC_PATH_PROG([PYTHON], [$PYTHON], [])
AC_ARG_VAR([NVCC], [CUDA compiler command])
Expand Down
53 changes: 53 additions & 0 deletions doc/install/howto-install-AMUSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,56 @@ individual codes can be build with:
make {code}.code
with {code} the name of the code in lower case.
Installation on HPC systems using modules (tested for Snellius)
***************************************************************
Note that the modules on your local HPC system may be differently named.
.. code-block:: sh
module load 2022
module load foss/2022a
Load python.
.. code-block:: sh
module load Python/3.10.4-GCCcore-11.3.0 # or another version of python, 3.7 or higher
Following AMUSE documentation (see above), download/upgrade the python package: (--user is required by Snellius)
.. code-block:: sh
mkdir MY_PROJECT_DIR
cd MY_PROJECT_DIR
python3 -m venv env # initialise a Python virtual environment, which will contain all the packages we install
source env/bin/activate # activate the virtual environment - this must be repeated every time you log in
pip install --upgrade pip
cd AMUSE_DIR # change to where you downloaded AMUSE
pip install -r requirements.txt --upgrade # install/upgrade all required packages
pip install matplotlib # not required but highly recommended
pip install -e .
Now you can build the AMUSE framework with
.. code-block:: sh
make framework
Finally, build AMUSE individual codes by running from the AMUSE directory:
.. code-block:: sh
make {code}.code
When you log in again (and in your SLURM scripts), you will need to load the same modules and activate the same environment:
.. code-block:: sh
module load 2022
module load foss/2022a
module load Python/3.10.4-GCCcore-11.3.0 # or another version of python, 3.7 or higher
cd MY_PROJECT_DIR
source env/bin/activate
Loading

0 comments on commit e99310e

Please sign in to comment.