Skip to content

Commit

Permalink
Merge pull request #433 from Pressio/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
fnrizzi authored Oct 18, 2022
2 parents 54fd788 + 5af2fa1 commit a14468b
Show file tree
Hide file tree
Showing 1,740 changed files with 44,083 additions and 146,171 deletions.
137 changes: 29 additions & 108 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,145 +134,66 @@ jobs:
############################## JOB `CI-trilinos` defined below ##############################
CI-trilinos:
runs-on: ubuntu-20.04

strategy:
matrix:
config:
# - {
# name: "ubuntu_20.04_gcc",
# build_type: "Debug", cc: "gcc", cxx: "g++",
# options: "-eigen-path=/home/runner/work/pressio/pressio_builds/eigen/install -gtest-path=/home/runner/work/pressio/pressio_builds/gtest/install",
# envscript: "",
# requirements: "",
# ctest_build: /home/runner/work/pressio/pressio_builds/pressio/build
# }


# - {
# name: "ubuntu_20.04_clang",
# build_type: "Debug", cc: "clang", cxx: "clang++",
# options: "-eigen-path=/home/runner/work/pressio/pressio_builds/eigen/install -gtest-path=/home/runner/work/pressio/pressio_builds/gtest/install",
# envscript: "",
# requirements: "",
# ctest_build: /home/runner/work/pressio/pressio_builds/pressio/build
# }

- {
trilinos_release: "13.0.0",
name: "ubuntu_20.04_gcc_openmpi_trilinos_release_13.0.0",
os: ubuntu-latest,
image: ubuntu-20.04-gnu_10-eigen_3.3.7-gtest-trilinos_hash-ef73d14babf6e7556b0420add98cce257ccaa56b,
build_type: "Release", cc: "mpicc", cxx: "mpicxx",
options: "-cmake-generator-name=default_mpi_trilinos_with_tests -eigen-path=/home/runner/work/pressio/pressio_builds/eigen/install -gtest-path=/home/runner/work/pressio/pressio_builds/gtest/install -trilinos-path=/home/runner/work/pressio/pressio_builds/trilinos/install",
envscript: "-env-script=/home/runner/work/pressio/pressio_repos/pressio-builder/sample_env_scripts/setenv_mpi_ubuntu_ci.sh",
requirements: "sudo apt install -y openmpi-bin libopenmpi-dev;sudo sed -i -e '$alocalhost slots=4' /etc/openmpi/openmpi-default-hostfile",
ctest_build: /home/runner/work/pressio/pressio_builds/pressio/build
requirements: "apt install -y openmpi-bin libopenmpi-dev;sed -i -e '$alocalhost slots=4' /etc/openmpi/openmpi-default-hostfile",
}

- {
trilinos_release: "13.0.0",
name: "ubuntu_20.04_gcc_openmpi_trilinos_debug_13.0.0",
os: ubuntu-latest,
image: ubuntu-20.04-gnu_10-eigen_3.3.7-gtest-trilinos_hash-ef73d14babf6e7556b0420add98cce257ccaa56b,
build_type: "Debug", cc: "mpicc", cxx: "mpicxx",
options: "-cmake-generator-name=default_mpi_trilinos_with_tests -eigen-path=/home/runner/work/pressio/pressio_builds/eigen/install -gtest-path=/home/runner/work/pressio/pressio_builds/gtest/install -trilinos-path=/home/runner/work/pressio/pressio_builds/trilinos/install",
envscript: "-env-script=/home/runner/work/pressio/pressio_repos/pressio-builder/sample_env_scripts/setenv_mpi_ubuntu_ci.sh",
requirements: "sudo apt install -y openmpi-bin libopenmpi-dev;sudo sed -i -e '$alocalhost slots=4' /etc/openmpi/openmpi-default-hostfile",
ctest_build: /home/runner/work/pressio/pressio_builds/pressio/build
requirements: "apt install -y openmpi-bin libopenmpi-dev;sed -i -e '$alocalhost slots=4' /etc/openmpi/openmpi-default-hostfile",
}

- {
trilinos_release: "13.0.1",
name: "ubuntu_20.04_gcc_openmpi_trilinos_release_13.0.1",
build_type: "Release", cc: "mpicc", cxx: "mpicxx",
options: "-cmake-generator-name=default_mpi_trilinos_with_tests -eigen-path=/home/runner/work/pressio/pressio_builds/eigen/install -gtest-path=/home/runner/work/pressio/pressio_builds/gtest/install -trilinos-path=/home/runner/work/pressio/pressio_builds/trilinos/install",
envscript: "-env-script=/home/runner/work/pressio/pressio_repos/pressio-builder/sample_env_scripts/setenv_mpi_ubuntu_ci.sh",
requirements: "sudo apt install -y openmpi-bin libopenmpi-dev;sudo sed -i -e '$alocalhost slots=4' /etc/openmpi/openmpi-default-hostfile",
ctest_build: /home/runner/work/pressio/pressio_builds/pressio/build
}
runs-on: ${{ matrix.config.os }}

- {
trilinos_release: "13.0.1",
name: "ubuntu_20.04_gcc_openmpi_trilinos_debug_13.0.1",
build_type: "Debug", cc: "mpicc", cxx: "mpicxx",
options: "-cmake-generator-name=default_mpi_trilinos_with_tests -eigen-path=/home/runner/work/pressio/pressio_builds/eigen/install -gtest-path=/home/runner/work/pressio/pressio_builds/gtest/install -trilinos-path=/home/runner/work/pressio/pressio_builds/trilinos/install",
envscript: "-env-script=/home/runner/work/pressio/pressio_repos/pressio-builder/sample_env_scripts/setenv_mpi_ubuntu_ci.sh",
requirements: "sudo apt install -y openmpi-bin libopenmpi-dev;sudo sed -i -e '$alocalhost slots=4' /etc/openmpi/openmpi-default-hostfile",
ctest_build: /home/runner/work/pressio/pressio_builds/pressio/build
}
container: pressiomodelreduction/${{ matrix.config.image }}

# - {
# name: "ubuntu_20.04_gcc_coverage",
# build_type: "Debug", cc: "gcc", cxx: "g++",
# options: "-cmake-generator-name=default_with_tests_codecov -eigen-path=/home/runner/work/pressio/pressio_builds/eigen/install -gtest-path=/home/runner/work/pressio/pressio_builds/gtest/install",
# envscript: "",
# requirements: "sudo apt install gcovr",
# ctest_build: /home/runner/work/pressio/pressio_builds/pressio/build,
# coverage: true,
# coverage_filename: "pressio_tests_coverage.xml",
# coverage_uploadname: "codecoverage-pressio",
# flag: "pressio-packages"
# }

# - {
# name: "Ubuntu 20.04 MPI - trilinos - coverage",
# build_type: "Debug", cc: "mpicc", cxx: "mpicxx",
# options: "-cmake-generator-name=default_mpi_trilinos_with_tests_codecov -eigen-path=/home/runner/work/pressio/pressio_builds/eigen/install -gtest-path=/home/runner/work/pressio/pressio_builds/gtest/install -trilinos-path=/home/runner/work/pressio/pressio_builds/trilinos/install",
# envscript: "--ncpu-for-make=1 -env-script=/home/runner/work/pressio/pressio_repos/pressio-builder/sample_env_scripts/setenv_mpi_ubuntu_ci.sh",
# requirements: "sudo apt install -y gcovr openmpi-bin libopenmpi-dev;sudo sed -i -e '$alocalhost slots=4' /etc/openmpi/openmpi-default-hostfile",
# ctest_build: /home/runner/work/pressio/pressio_builds/pressio/build,
# coverage: true,
# coverage_filename: "pressio_tests_mpi_coverage.xml",
# coverage_uploadname: "codecoverage-pressio-trilinos",
# flag: "pressio-trilinos-packages"
# }
env:
pressio_dir: /__w/pressio/pressio
pressio_builder_dir: /home/pressio_repos/pressio-builder
pressio_builds_dir: /home/pressio_builds
ctest_build: /home/pressio_builds/pressio/build

steps:
- uses: actions/checkout@v1
- name: Creating environnement...
- name: Creating environnement
run: |
cd ..
mkdir pressio_repos
PARENT_DIR=$(pwd)
echo "WORKSPACE_PARENT_DIR=$PARENT_DIR" >> $GITHUB_ENV
echo "PRESSIO_REPOS=$PARENT_DIR/pressio_repos" >> $GITHUB_ENV
echo "PRESSIO_BUILDS=$PARENT_DIR/pressio_builds" >> $GITHUB_ENV
sudo apt-get update
apt-get update -y
${{ matrix.config.requirements }}
- name: Cloning Pressio Builder...
- name: Pressio Builder Update
run: |
cd ${{ env.PRESSIO_REPOS }}
git clone git://github.com/Pressio/pressio-builder.git
cd pressio-builder
cd ${{ env.pressio_builder_dir }}
git checkout main
- name: Get TPLs...
run: |
export TERM=xterm
docker run -di pressiomodelreduction/ubuntu-20.04-gnu_10-eigen_3.3.7-gtest-trilinos_rel_${{ matrix.config.trilinos_release }}
TNAME=$(docker ps --format "{{.Names}}")
docker cp $TNAME:/home/pressio_builds ${{ env.WORKSPACE_PARENT_DIR }}
docker stop $TNAME
docker rm $TNAME
docker image rm pressiomodelreduction/ubuntu-20.04-gnu_10-eigen_3.3.7-gtest-trilinos_rel_${{ matrix.config.trilinos_release }}
git pull
- name: Build
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: |
export TERM=xterm
cd ${{ env.PRESSIO_REPOS }}/pressio-builder
./main_pressio.sh ${{ matrix.config.envscript }} -dryrun=no \
-build-mode=${{ matrix.config.build_type }} \
-pressio-src=${{ env.WORKSPACE_PARENT_DIR }}/pressio \
-target-dir=${{ env.PRESSIO_BUILDS }} \
-cmake-generator-name=default_with_tests ${{ matrix.config.options }} \
-ncpu-for-make=4
cd ${{ env.pressio_builder_dir }}
./main_pressio.sh -env-script=${{ env.pressio_builder_dir }}/sample_env_scripts/setenv_mpi_ubuntu_ci.sh \
-dryrun=no -build-mode=${{ matrix.config.build_type }} -pressio-src=${{ env.pressio_dir }} \
-target-dir=${{ env.pressio_builds_dir }} -cmake-generator-name=default_mpi_trilinos_with_tests \
-eigen-path=${{ env.pressio_builds_dir }}/eigen/install -gtest-path=${{ env.pressio_builds_dir }}/gtest/install \
-trilinos-path=${{ env.pressio_builds_dir }}/trilinos/install -ncpu-for-make=4
- name: Test
run: |
cd ${{ matrix.config.ctest_build }}
export LD_LIBRARY_PATH=${{ env.PRESSIO_BUILDS }}/trilinos/install/lib
ctest --output-on-failure
cd ${{ env.ctest_build }}
export LD_LIBRARY_PATH=${{ env.pressio_builds_dir }}/trilinos/install/lib
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
ctest -j 4 --output-on-failure
# - if: ${{ matrix.config.coverage }}
# name: Generate code coverage
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy docs

on:
push:
branches: [ main ]

jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
env:
docs-directory: /home/runner/work/pressio/pressio/docs
python-version: '3.10'

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
architecture: 'x64'
- name: Install Python dependencies
run: |
pip3 install -r ./docs/build_requirements.txt
- name: Build documentation
working-directory: ${{ env.docs-directory }}
run: |
make html
# .nojekyll file is needed for GitHub Pages to know it's getting a ready webpage
# and there is no need to generate anything
- name: Generate nojekyll file
working-directory: ${{ env.docs-directory }}/generated_docs
run: touch .nojekyll
# This action moves the content of `generated_docs` to the branch from where
# the site is published
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: website-deployment
folder: ${{ env.docs-directory }}/generated_docs
clean: true
34 changes: 25 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include(colors)
# versioning
#=====================================================================
set(Pressio_VERSION_MAJOR 0)
set(Pressio_VERSION_MINOR 12)
set(Pressio_VERSION_MINOR 13)
set(Pressio_VERSION_PATCH 0)
set(Pressio_VERSION
"${Pressio_VERSION_MAJOR}.${Pressio_VERSION_MINOR}.${Pressio_VERSION_PATCH}")
Expand Down Expand Up @@ -47,15 +47,31 @@ endif()
#=====================================================================
# c++ standard
#=====================================================================
SET(PRESSIO_ENABLE_CXX17 OFF)
SET(PRESSIO_ENABLE_CXX20 OFF)

IF (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
ENDIF()
MESSAGE(STATUS "Setting CXX standard to ${CMAKE_CXX_STANDARD}")

IF(CMAKE_CXX_STANDARD STREQUAL "17")
SET(PRESSIO_ENABLE_CXX17 ON)
ELSEIF(CMAKE_CXX_STANDARD STREQUAL "20")
SET(PRESSIO_ENABLE_CXX20 ON)
ENDIF()

# commands to test if compiler supports standard
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++14" COMPILER_SUPPORT_CPP14)
if(NOT COMPILER_SUPPORT_CPP14)
message(FATAL_ERROR "Compiler does not support -std=c++14. This is required.")
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#include(CheckCXXCompilerFlag)
#check_cxx_compiler_flag("-std=c++14" COMPILER_SUPPORT_CPP14)
#if(NOT COMPILER_SUPPORT_CPP14)
# message(FATAL_ERROR "Compiler does not support -std=c++14. This is required.")
#endif()
#set(CMAKE_CXX_STANDARD 14)
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_CXX_EXTENSIONS OFF)

#=====================================================================
# do processing
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,33 @@

Pressio is an open-source computational framework aimed at advancing
the field of reduced-order models (ROMs) for dynamical systems in science and engineering.
We employ generic programming, and target shared and distributed-memory
applications using arbitrary data-types and diverse programming models.
We employ generic programming, and target shared
and distributed-memory applications using arbitrary data-types and diverse programming models.

We believe that the key to develop such a capability from the ground up
is to properly identify the building blocks and modularize them accordingly.
This is the approach we have adopted: the library is broken into
several components such that they can be used independently
and in a self-contained fashion.
This is the approach adopted here: the library is composed of
several components that can be used independently and in a self-contained fashion,
but as a whole constitute the stack foundation of the rom component.
One of the main outcome of this is that regardless of your interest in ROMs,
you might find useful some of the components of the library.


Click below to checkout the documentation:

<a href="https://pressio.github.io/pressio/html/index.html" target="_blank">
<img src='logo-readme.svg' width='95%'>
<img src='./logos/logo-readme.svg' width='95%'>
</a>

## Development, versioning and backward compatibility

Until we reach a stable 1.0, please be patient and do not be surprised if the API
and functionalities somewhat rapidly change from one 0.x version to the next,
thus affecting backward compability.
Some components of pressio are more mature and stable than others,
but until we can claim the *same stability* level for all,
please keep this mind.

## Questions?
Find us on Slack: https://pressioteam.slack.com and/or
open an issue on [github](https://github.com/Pressio/pressio).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM ubuntu:focal
# Declaring build variables
ARG TZ=Europe/Warsaw
ARG CMAKE_VERSION=3.18.6
ARG GNU_VER=10
ARG CC=gcc-$GNU_VER
ARG CXX=g++-$GNU_VER
ARG GFORTRAN=gfortran-$GNU_VER

# Setting timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# System update and packages installation
RUN apt-get update && apt-get upgrade -y
# Installing Utilities
RUN apt-get install -y wget git make python3 python3-numpy
# Installing OpenMPI
RUN apt-get install -y openmpi-bin openmpi-doc
# Installing BLAS, LAPACK
RUN apt-get install -y libopenblas-dev liblapack-dev

# CMake installation
RUN wget -O cmake.sh https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.sh
RUN sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local/
RUN rm cmake.sh

# Compilers installation
RUN apt-get install -y $CC $CXX $GFORTRAN
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/$CC 10
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/$CXX 10
RUN update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/$GFORTRAN 10
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 20
RUN update-alternatives --set cc /usr/bin/gcc
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 20
RUN update-alternatives --set c++ /usr/bin/g++
RUN update-alternatives --install /usr/bin/fortrann fortrann /usr/bin/gfortran 20
RUN update-alternatives --set fortrann /usr/bin/gfortran

# Setting environment variables
ENV CC=/usr/bin/mpicc
ENV CXX=/usr/bin/mpic++
ENV FC=/usr/bin/mpifort
ENV F77=/usr/bin/mpifort
ENV F90=/usr/bin/mpifort
ENV MPIRUNe=/usr/bin/mpirun

# Building TPLs
WORKDIR /home
RUN mkdir pressio_builds
RUN mkdir pressio_repos
WORKDIR /home/pressio_repos
RUN git clone https://github.com/Pressio/pressio-builder.git
WORKDIR /home/pressio_repos/pressio-builder
RUN git checkout main
RUN sed -i 's/source .\/shared\/colors.sh/# colors commnted out/g' main_tpls.sh
RUN sed -i 's/9fec35276d846a667bc668ff4cbdfd8be0dfea08/ef73d14babf6e7556b0420add98cce257ccaa56b/g' tpls/tpls_versions_details.sh
RUN sed -i 's/GTESTBRANCH=master/GTESTBRANCH=main/g' tpls/tpls_versions_details.sh
RUN chmod +x main_tpls.sh
RUN ./main_tpls.sh -dryrun=no -build-mode=Release -target-dir=../../pressio_builds -tpls=gtest,eigen,trilinos -cmake-generator-names=default,default,default
RUN git reset --hard origin/main

# Cleaning after builds
WORKDIR /home
RUN rm -rf pressio_builds/gtest/build && rm -rf pressio_builds/gtest/googletest
RUN rm -rf pressio_builds/trilinos/build && rm -rf pressio_builds/trilinos/Trilinos
RUN rm -rf pressio_builds/eigen/eigen-3.3.7 && rm pressio_builds/eigen/eigen-3.3.7.tar.gz

# Setting workdir to /
WORKDIR /
Loading

0 comments on commit a14468b

Please sign in to comment.