diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 30466d17298..f67d5044469 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "GEOS_TPL_TAG": "260-235" + "GEOS_TPL_TAG": "259-158" } }, "runArgs": [ diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index b34d56c8e70..4f11056a53a 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -31,6 +31,9 @@ on: ENABLE_HYPRE_DEVICE: required: false type: string + ENABLE_PYGEOSX: + required: false + type: string ENABLE_TRILINOS: required: false type: string @@ -149,6 +152,12 @@ jobs: docker_args+=(-e ENABLE_HYPRE_DEVICE=${ENABLE_HYPRE_DEVICE:-CPU}) docker_args+=(-e ENABLE_TRILINOS=${ENABLE_TRILINOS:-ON}) + + # pygeosx testing + if [ "${{ inputs.ENABLE_PYGEOSX }}" == 'ON' ]; then + script_args+=(--run-pygeosx-tests) + fi + docker_args+=(--cap-add=SYS_PTRACE --rm) script_args+=(--cmake-build-type ${{ inputs.CMAKE_BUILD_TYPE }}) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 150718bf957..f203a63b52f 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -127,14 +127,17 @@ jobs: - name: Ubuntu (20.04, gcc 9.4.0, open-mpi 4.0.3) CMAKE_BUILD_TYPE: Release DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc9 + ENABLE_PYGEOSX: ON - name: Ubuntu debug (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces CMAKE_BUILD_TYPE: Debug DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10 + ENABLE_PYGEOSX: ON - name: Ubuntu (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces CMAKE_BUILD_TYPE: Release DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10 + ENABLE_PYGEOSX: ON - name: Ubuntu (22.04, gcc 11.4.0, open-mpi 4.1.2) CMAKE_BUILD_TYPE: Release @@ -142,12 +145,14 @@ jobs: ENABLE_HYPRE: ON ENABLE_TRILINOS: OFF GCP_BUCKET: geosx/ubuntu22.04-gcc11 + ENABLE_PYGEOSX: ON - name: Ubuntu (22.04, gcc 12.3.0, open-mpi 4.1.2) CMAKE_BUILD_TYPE: Release DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc12 ENABLE_HYPRE: ON ENABLE_TRILINOS: OFF + ENABLE_PYGEOSX: ON - name: Ubuntu (22.04, clang 15.0.7, open-mpi 4.1.2) CMAKE_BUILD_TYPE: Release @@ -182,6 +187,7 @@ jobs: DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }} DOCKER_REPOSITORY: ${{ matrix.DOCKER_REPOSITORY }} ENABLE_HYPRE: ${{ matrix.ENABLE_HYPRE }} + ENABLE_PYGEOSX: ${{ matrix.ENABLE_PYGEOSX }} ENABLE_TRILINOS: ${{ matrix.ENABLE_TRILINOS }} GCP_BUCKET: ${{ matrix.GCP_BUCKET }} HOST_CONFIG: ${{ matrix.HOST_CONFIG }} diff --git a/host-configs/environment.cmake b/host-configs/environment.cmake index c4db8c745a2..0ba00532a07 100644 --- a/host-configs/environment.cmake +++ b/host-configs/environment.cmake @@ -24,6 +24,17 @@ else() set(ENABLE_HYPRE OFF CACHE BOOL "" FORCE) endif() +# pygeosx +if(NOT DEFINED ENABLE_PYGEOSX) + set(ENABLE_PYGEOSX "$ENV{ENABLE_PYGEOSX}" CACHE BOOL "" FORCE) +endif() +if(ENABLE_PYGEOSX) + set(Python3_EXECUTABLE /usr/bin/python3 CACHE PATH "") + set(ENABLE_PYLVARRAY ON CACHE BOOL "") +else() + set(ENABLE_PYGEOSX OFF CACHE BOOL "" FORCE) +endif() + # Same pattern if(NOT DEFINED ENABLE_TRILINOS) set(ENABLE_TRILINOS "$ENV{ENABLE_TRILINOS}" CACHE BOOL "" FORCE) diff --git a/scripts/ci_build_and_test_in_container.sh b/scripts/ci_build_and_test_in_container.sh index 84e5966968a..216019c6d93 100755 --- a/scripts/ci_build_and_test_in_container.sh +++ b/scripts/ci_build_and_test_in_container.sh @@ -51,7 +51,9 @@ Usage: $0 --no-run-unit-tests Do not run the unit tests (but they will be built). --repository /path/to/repository - Internal mountpoint where the geos repository will be available. + Internal mountpoint where the geos repository will be available. + --run-pygeosx-tests + Runs the pygeosx tests. --run-integrated-tests Run the integrated tests. Then bundle and send the results to the cloud. --sccache-credentials credentials.json @@ -68,13 +70,14 @@ exit 1 or_die cd $(dirname $0)/.. # Parsing using getopt -args=$(or_die getopt -a -o h --long build-exe-only,cmake-build-type:,code-coverage,data-basename:,exchange-dir:,host-config:,install-dir-basename:,no-install-schema,no-run-unit-tests,repository:,run-integrated-tests,sccache-credentials:,test-code-style,test-documentation,help -- "$@") +args=$(or_die getopt -a -o h --long build-exe-only,cmake-build-type:,code-coverage,data-basename:,exchange-dir:,host-config:,install-dir-basename:,no-install-schema,no-run-unit-tests,repository:,run-pygeosx-tests,run-integrated-tests,sccache-credentials:,test-code-style,test-documentation,help -- "$@") # Variables with default values BUILD_EXE_ONLY=false GEOSX_INSTALL_SCHEMA=true HOST_CONFIG="host-configs/environment.cmake" RUN_UNIT_TESTS=true +RUN_PYGEOSX_TESTS=false RUN_INTEGRATED_TESTS=false TEST_CODE_STYLE=false TEST_DOCUMENTATION=false @@ -105,6 +108,7 @@ do --no-install-schema) GEOSX_INSTALL_SCHEMA=false; shift;; --no-run-unit-tests) RUN_UNIT_TESTS=false; shift;; --repository) GEOS_SRC_DIR=$2; shift 2;; + --run-pygeosx-tests) RUN_PYGEOSX_TESTS=true; shift;; --run-integrated-tests) RUN_INTEGRATED_TESTS=true; shift;; --code-coverage) CODE_COVERAGE=true; shift;; --sccache-credentials) SCCACHE_CREDS=$2; shift 2;; @@ -180,6 +184,10 @@ if [[ "${RUN_INTEGRATED_TESTS}" = true ]]; then ATS_CMAKE_ARGS="-DATS_ARGUMENTS=\"--machine openmpi --ats openmpi_mpirun=/usr/bin/mpirun --ats openmpi_args=--allow-run-as-root --ats openmpi_procspernode=4 --ats openmpi_maxprocs=4\" -DPython3_ROOT_DIR=${ATS_PYTHON_HOME}" fi +# Set CMake option for pygeosx +if [[ "${RUN_PYGEOSX_TESTS}" = true ]]; then + PYGEOSX_CMAKE_ARG="-DENABLE_PYGEOSX=ON" +fi if [[ "${CODE_COVERAGE}" = true ]]; then or_die apt-get update @@ -212,7 +220,8 @@ or_die python3 scripts/config-build.py \ -DGEOSX_INSTALL_SCHEMA=${GEOSX_INSTALL_SCHEMA} \ -DENABLE_COVERAGE=$([[ "${CODE_COVERAGE}" = true ]] && echo 1 || echo 0) \ ${SCCACHE_CMAKE_ARGS} \ - ${ATS_CMAKE_ARGS} + ${ATS_CMAKE_ARGS} \ + ${PYGEOSX_CMAKE_ARG} # The configuration step is now over, we can now move to the build directory for the build! or_die cd ${GEOSX_BUILD_DIR} @@ -236,6 +245,12 @@ else or_die ninja -j $NPROC or_die ninja install + if [[ "${RUN_PYGEOSX_TESTS}" = true ]]; then + or_die ninja pygeosx + or_die ninja geosx_python_tools + or_die ninja pygeosx_unit_tests + fi + if [[ ! -z "${DATA_BASENAME_WE}" ]]; then # Here we pack the installation. # The `--transform` parameter provides consistency between the tarball name and the unpacked folder. diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 85548940940..ec945878426 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -473,6 +473,7 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): if '+pygeosx' in spec: cfg.write(cmake_cache_option('ENABLE_PYGEOSX', True)) + cfg.write(cmake_cache_option('ENABLE_PYLVARRAY', True)) else: cfg.write(cmake_cache_option('ENABLE_PYGEOSX', False)) diff --git a/src/coreComponents/LvArray b/src/coreComponents/LvArray index 1531241583e..896d25fb60a 160000 --- a/src/coreComponents/LvArray +++ b/src/coreComponents/LvArray @@ -1 +1 @@ -Subproject commit 1531241583eebe21cfcdc0facd16a80f1e03c939 +Subproject commit 896d25fb60aa882cc081186069558e9885a16d16