Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
repo-path: 'kokkos/kokkos'
repo-ref: '4.6.01'
cache: true
options: '-DCMAKE_CXX_STANDARD=17
options: '-DCMAKE_CXX_STANDARD=20
-DBUILD_SHARED_LIBS=OFF
-DKokkos_ENABLE_SERIAL=ON
-DKokkos_ENABLE_OPENMP=OFF
Expand All @@ -78,7 +78,7 @@ jobs:
repo-path: 'kokkos/kokkos-kernels'
repo-ref: '4.6.01'
cache: true
options: '-DCMAKE_CXX_STANDARD=17
options: '-DCMAKE_CXX_STANDARD=20
-DBUILD_SHARED_LIBS=OFF
-DKokkos_DIR=${{ runner.temp }}/build-kokkos-openmpi/install/lib/cmake/Kokkos'

Expand Down
63 changes: 51 additions & 12 deletions .github/workflows/cmake-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ jobs:
compiler: [g++]
language: ['cpp']
python_api: [OFF, ON]
meshfields: [ON]
petsc: [ON]
include:
- build_type: Release
memory_test: OFF
compiler: g++
language: 'cpp'
python_api: OFF
meshfields: OFF
petsc: ON
- build_type: Release
memory_test: OFF
compiler: g++
language: 'cpp'
python_api: OFF
meshfields: ON
petsc: OFF
exclude:
- build_type: Release
memory_test: ON
Expand Down Expand Up @@ -68,7 +85,7 @@ jobs:
repo-ref: '4.6.01'
cache: true
cache-suffix: ${{ matrix.python_api == 'ON' && '-shared' || '' }}
options: '-DCMAKE_CXX_STANDARD=17
options: '-DCMAKE_CXX_STANDARD=20
-DBUILD_SHARED_LIBS=${{ matrix.python_api }}
-DKokkos_ENABLE_SERIAL=ON
-DKokkos_ENABLE_OPENMP=OFF
Expand All @@ -84,7 +101,7 @@ jobs:
repo-ref: '4.6.01'
cache: true
cache-suffix: ${{ matrix.python_api == 'ON' && '-shared' || '' }}
options: '-DCMAKE_CXX_STANDARD=17
options: '-DCMAKE_CXX_STANDARD=20
-DBUILD_SHARED_LIBS=${{ matrix.python_api }}
-DKokkos_DIR=${{ runner.temp }}/build-kokkos/install/lib/cmake/Kokkos'

Expand All @@ -106,6 +123,7 @@ jobs:
-DKokkos_DIR=${{ runner.temp }}/build-kokkos/install/lib/cmake/Kokkos'

- name: build meshFields
if: matrix.meshfields == 'ON'
uses: ./.github/actions/install-repo
with:
repo-name: 'meshFields'
Expand Down Expand Up @@ -154,6 +172,7 @@ jobs:
-Dperfstubs_DIR=${{ runner.temp }}/build-perfstubs/install/lib/cmake'

- name: clone petsc
if: matrix.petsc == 'ON'
id: clone-petsc
run: |
cd ${{ runner.temp }}
Expand All @@ -162,14 +181,15 @@ jobs:
echo "petsc-commit-hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

- name: Cache PETSc
if: matrix.petsc == 'ON'
id: cache-petsc
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/petsc
key: build-petsc-${{ steps.clone-petsc.outputs.petsc-commit-hash }}

- name: build petsc
if: steps.cache-petsc.outputs.cache-hit != 'true'
if: matrix.petsc == 'ON' && steps.cache-petsc.outputs.cache-hit != 'true'
run: |
cd ${{ runner.temp }}/petsc
./configure \
Expand All @@ -181,6 +201,15 @@ jobs:
--download-fblaslapack
make all check

- name: Set PCMS PETSc options
run: |
echo "PCMS_ENABLE_PETSC=-DPCMS_ENABLE_PETSC=${{ matrix.petsc }}" >> $GITHUB_ENV
if [ "${{ matrix.petsc }}" = "ON" ]; then
echo "PCMS_PETSC_OPTIONS=-DPETSC_LINK_STATIC=ON -DPETSC_DIR=${{ runner.temp }}/petsc -DPETSC_ARCH=ubuntu-kokkos" >> $GITHUB_ENV
else
echo "PCMS_PETSC_OPTIONS=" >> $GITHUB_ENV
fi

- name: checkout pcms_testcases
uses: actions/checkout@v3
with:
Expand All @@ -193,7 +222,20 @@ jobs:
- name: Set LD_LIBRARY_PATH for shared libraries
if: matrix.python_api == 'ON'
run: |
echo "LD_LIBRARY_PATH=${{ runner.temp }}/build-kokkos/install/lib:${{ runner.temp }}/build-omega_h/install/lib:${{ runner.temp }}/build-meshFields/install/lib:${{ runner.temp }}/build-redev/install/lib:${{ runner.temp }}/build-ADIOS2/install/lib:${{ runner.temp }}/build-perfstubs/install/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
meshfields_lib=""
if [ "${{ matrix.meshfields }}" = "ON" ]; then
meshfields_lib="${{ runner.temp }}/build-meshFields/install/lib:"
fi
echo "LD_LIBRARY_PATH=${{ runner.temp }}/build-kokkos/install/lib:${{ runner.temp }}/build-omega_h/install/lib:${meshfields_lib}${{ runner.temp }}/build-redev/install/lib:${{ runner.temp }}/build-ADIOS2/install/lib:${{ runner.temp }}/build-perfstubs/install/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV

- name: Set PCMS MeshFields options
run: |
echo "PCMS_ENABLE_MESHFIELDS=-DPCMS_ENABLE_MESHFIELDS=${{ matrix.meshfields }}" >> $GITHUB_ENV
if [ "${{ matrix.meshfields }}" = "ON" ]; then
echo "PCMS_MESHFIELDS_DIR=-Dmeshfields_DIR=${{ runner.temp }}/build-meshFields/install/lib/cmake/meshfields" >> $GITHUB_ENV
else
echo "PCMS_MESHFIELDS_DIR=" >> $GITHUB_ENV
fi

- name: build pcms
uses: ./.github/actions/install-repo
Expand All @@ -207,16 +249,15 @@ jobs:
-DCMAKE_CXX_COMPILER=`which mpicxx`
-DCMAKE_Fortran_COMPILER=`which mpifort`
-DMPIEXEC_PREFLAGS="--oversubscribe"
-DPCMS_ENABLE_PETSC=ON
-DPETSC_LINK_STATIC=ON
-DPETSC_DIR=${{ runner.temp }}/petsc
-DPETSC_ARCH=ubuntu-kokkos
${{ env.PCMS_ENABLE_MESHFIELDS }}
${{ env.PCMS_ENABLE_PETSC }}
${{ env.PCMS_PETSC_OPTIONS }}
-DPCMS_TIMEOUT=10
-DPCMS_ENABLE_SPDLOG=OFF
-DPCMS_ENABLE_Python=${{ matrix.python_api }}
-DCatch2_DIR=${{ runner.temp }}/build-Catch2/install/lib/cmake/Catch2
-DOmega_h_DIR=${{ runner.temp }}/build-omega_h/install/lib/cmake/Omega_h
-Dmeshfields_DIR=${{ runner.temp }}/build-meshFields/install/lib/cmake/meshfields
${{ env.PCMS_MESHFIELDS_DIR }}
-Dredev_DIR=${{ runner.temp }}/build-redev/install/lib/cmake/redev
-DMPIEXEC_EXECUTABLE=`which mpirun`
-DADIOS2_DIR=${{ runner.temp }}/build-ADIOS2/install/lib/cmake/adios2
Expand Down Expand Up @@ -264,8 +305,6 @@ jobs:
-B ${{github.workspace}}/examples/external-usage-example/build \
-S ${{github.workspace}}/examples/external-usage-example/ \
-Dpcms_DIR=${{ runner.temp }}/build-pcms/install/lib/cmake/pcms \
-DPETSC_LINK_STATIC=ON \
-DPETSC_DIR=${{ runner.temp }}/petsc \
-DPETSC_ARCH=ubuntu-kokkos \
${{ matrix.petsc == 'ON' && format('-DPETSC_LINK_STATIC=ON -DPETSC_DIR={0}/petsc -DPETSC_ARCH=ubuntu-kokkos', runner.temp) || '' }} \
--debug-output
cmake --build ${{github.workspace}}/examples/external-usage-example/build
4 changes: 2 additions & 2 deletions .github/workflows/perlmutter/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build-pcms/install
# cmake -S kokkos-kernels -B build-kokkos-kernels \
# -DCMAKE_INSTALL_PREFIX=$PWD/build-kokkos-kernels/install \
# -DCMAKE_CXX_COMPILER=CC \
# -DCMAKE_CXX_STANDARD=17
# -DCMAKE_CXX_STANDARD=20
# cmake --build build-kokkos-kernels -j24 --target install


Expand Down Expand Up @@ -131,4 +131,4 @@ cmake -S pcms -B build-pcms \
-DPCMS_TIMEOUT=100 \
-DCMAKE_CXX_STANDARD=20 \
-DPCMS_TEST_DATA_DIR=$PWD/pcms_testcases
cmake --build build-pcms -j8
cmake --build build-pcms -j8
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module load cuda/12.1.1-zxa4msk
git clone --branch 4.6.01 --depth 1 git@github.com:kokkos/kokkos.git
cmake -S kokkos -B build-kokkos \
-DCMAKE_INSTALL_PREFIX=build-kokkos/install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=20 \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=OFF \
-DKokkos_ENABLE_CUDA=OFF \
Expand All @@ -44,7 +44,7 @@ cmake --build build-kokkos --target install
git clone --branch 4.6.01 --depth 1 git@github.com:kokkos/kokkos-kernels.git
cmake -S kokkos-kernels -B build-kokkos-kernels \
-DCMAKE_INSTALL_PREFIX=build-kokkos-kernels/install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=20 \
-DKokkos_ROOT=$PWD/build-kokkos/install/lib64/cmake \
-DBUILD_SHARED_LIBS=OFF
cmake --build build-kokkos-kernels --target install
Expand Down Expand Up @@ -97,7 +97,7 @@ cmake --build build-redev --target install
git clone --branch 4.6.01 --depth 1 git@github.com:kokkos/kokkos.git
cmake -S kokkos -B build-kokkos \
-DCMAKE_INSTALL_PREFIX=build-kokkos/install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_CXX_COMPILER=$PWD/kokkos/bin/nvcc_wrapper \
-DKokkos_ARCH_AMPERE80=ON \
Expand All @@ -112,7 +112,7 @@ cmake --build build-kokkos --target install
git clone --branch 4.6.01 --depth 1 git@github.com:kokkos/kokkos-kernels.git
cmake -S kokkos-kernels -B build-kokkos-kernels \
-DCMAKE_INSTALL_PREFIX=build-kokkos-kernels/install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=20 \
-DKokkos_ROOT=$PWD/build-kokkos/install/lib64/cmake \
-DBUILD_SHARED_LIBS=off
cmake --build build-kokkos-kernels --target install
Expand Down
1 change: 0 additions & 1 deletion examples/external-usage-example/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <iostream>
#include <pcms/utility/print.h>
#include <pcms/create_field.h>
#include <pcms/capi/interpolator.h>
int main()
{
Expand Down
31 changes: 23 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set(
pcms/coordinate_systems.h
pcms/coordinate_transform.h
pcms/field.h
pcms/create_field.h
pcms/field_communicator.h
pcms/field_communicator2.h
pcms/field_evaluation_methods.h
Expand All @@ -17,25 +16,23 @@ set(
pcms/coordinate_system.h
pcms/field_layout.h
pcms/field_layout_communicator.h
pcms/nodal_field_factory.h
)

set(
PCMS_SOURCES
pcms.cpp
pcms/create_field.cpp
pcms/coupler2.cpp
pcms/field_layout_communicator.cpp
pcms/nodal_field_factory.cpp
pcms/adapter/point_cloud/point_cloud_layout.cpp
pcms/adapter/point_cloud/point_cloud.cpp
pcms/adapter/meshfields/mesh_fields_adapter_layout.cpp
)
set(
ADAPTER_HEADERS
pcms/adapter/dummy_field_adapter.h
pcms/adapter/point_cloud/point_cloud_layout.h
pcms/adapter/point_cloud/point_cloud.h
pcms/adapter/meshfields/mesh_fields_adapter_layout.h
pcms/adapter/meshfields/mesh_fields_adapter2.h
pcms/adapter/xgc/xgc_field_adapter.h
)

Expand All @@ -52,21 +49,36 @@ if(PCMS_ENABLE_XGC)
list(APPEND PCMS_SOURCES pcms/adapter/xgc/xgc_reverse_classification.cpp)
list(APPEND ADAPTER_HEADERS pcms/adapter/xgc/xgc_reverse_classification.h)
endif()
if(PCMS_ENABLE_MESHFIELDS)
list(APPEND PCMS_SOURCES
pcms/adapter/meshfields/mesh_fields_adapter_layout.cpp
)
list(APPEND ADAPTER_HEADERS
pcms/adapter/meshfields/mesh_fields_adapter_layout.h
pcms/adapter/meshfields/mesh_fields_adapter2.h
pcms/adapter/meshfields/mesh_fields_adapter.h
)
endif()
if(PCMS_ENABLE_OMEGA_H)
list(APPEND PCMS_SOURCES
pcms/lagrange_field_factory.cpp
pcms/adapter/omega_h/omega_h_lagrange_layout.cpp
pcms/adapter/uniform_grid/uniform_grid_field_layout.cpp
pcms/adapter/uniform_grid/uniform_grid_field.cpp
)
list(
APPEND
PCMS_HEADERS
pcms/lagrange_field_factory.h
pcms/transfer_field.h
pcms/transfer_field2.h
)
list(APPEND ADAPTER_HEADERS
pcms/adapter/meshfields/mesh_fields_adapter.h
pcms/adapter/omega_h/omega_h_lagrange_layout.h
pcms/adapter/omega_h/omega_h_lagrange_field.h
pcms/adapter/uniform_grid/uniform_grid_field_layout.h
pcms/adapter/uniform_grid/uniform_grid_field.h
pcms/adapter/uniform_grid/uniform_grid_binary_field.h
)
endif()

Expand All @@ -79,11 +91,14 @@ set_target_properties(
core
)
add_library(pcms::core ALIAS pcms_core)
target_compile_features(pcms_core PUBLIC cxx_std_17)
target_compile_features(pcms_core PUBLIC cxx_std_20)
target_link_libraries(
pcms_core PUBLIC meshfields::meshfields redev::redev
pcms_core PUBLIC redev::redev
MPI::MPI_CXX Kokkos::kokkos perfstubs pcms::utility pcms::localization
)
if(PCMS_ENABLE_MESHFIELDS)
target_link_libraries(pcms_core PUBLIC meshfields::meshfields)
endif()
if(PCMS_ENABLE_OMEGA_H)
target_link_libraries(pcms_core PUBLIC Omega_h::omega_h)
endif()
Expand Down
Loading
Loading