Skip to content

Commit

Permalink
adding elements gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
djdunning committed Dec 11, 2024
1 parent 1863a0a commit 9b2c0c8
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .conda/elements/cuda/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2021, Los Alamos National Laboratory
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 changes: 23 additions & 0 deletions .conda/elements/cuda/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export SRC_DIR=$(pwd)
echo ${SRC_DIR}
mkdir -p build
cd build

export MPI_FLAGS="--allow-run-as-root"

if [ $(uname) == Linux ]; then
export MPI_FLAGS="$MPI_FLAGS;-mca;plm;isolated"
fi

source "$RECIPE_DIR/../../cross-compile-setup.sh"

cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \
-D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \
-D CMAKE_CXX_STANDARD:STRING=17 \
-D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \
-D Matar_ENABLE_KOKKOS=ON \
$CMAKE_ARGS \
$SRC_DIR \
-D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \

make install
54 changes: 54 additions & 0 deletions .conda/elements/cuda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% set version = "1.0.0" %}
{% set linux_compiler_version = "10.4.0" %}
#{% set macos_compiler_version = "16" %}

package:
name: elements-cuda
version: {{ version }}

source:
- git_url: https://github.com/lanl/ELEMENTS.git
git_depth: 1

build:
number: 1
noarch: False
script_env:
- PLATFORM={{ target_platform }} # [linux]
skip: True # [osx]
skip: False # [linux]

requirements: # [linux]
build:
- cmake >=3.17.0
- {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux]
#- {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx]
- cuda-toolkit
- matar-cuda
- openmpi
host:
- openmpi
- matar-cuda
- kokkos=4.1
run:
- openmpi
- matar-cuda
- kokkos=4.1

about:
home: https://github.com/lanl/ELEMENTS
license: BSD-3-Clause
license_family: BSD
license_file: LICENSE
summary:
LANL's for lagrangian mesh libraries.
description:
The C++ ELEMENTS library is a collection of sub-libraries to support implementing a diverse range
of numerical methods on low and high-order meshes. The ELEMENTS library can be used for research
and development of both continuous and discontinuous finite element methods, as well as,
finite volume methods to solve a diverse range of partial differential equations.
dev_url: https://github.com/lanl/Fierro

extra:
recipe-maintainers:
- fierromechanics
2 changes: 1 addition & 1 deletion .conda/matar/cuda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
number: 1
noarch: False
script_env:
- PLATFORM={{ target_platform }}
- PLATFORM={{ target_platform }} # [linux]
skip: True # [osx]
skip: False # [linux]

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/publish-elements-cuda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Publish Elements-Cuda'

on:
push:
paths:
- .conda/elements/**
- .github/workflows/publish-elements-cuda.yaml
workflow_dispatch:

jobs:
publish:
uses: ./.github/workflows/build-conda-package.yaml
with:
recipe_dir: .conda/elements/cuda
secrets: inherit

0 comments on commit 9b2c0c8

Please sign in to comment.