Skip to content

Commit

Permalink
FEATURE: adding evpfft-gpu package to our packages
Browse files Browse the repository at this point in the history
  • Loading branch information
djdunning committed Apr 9, 2024
1 parent c5c39b2 commit 0dce9a0
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 22 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/publish-evpfft-gpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Publish EVPFFT-GPU'

on:
push:
paths:
- .conda/evpfft/**
- src/EVPFFT/src/**
- .github/workflows/publish-evpfft-gpu.yaml
workflow_dispatch:

jobs:
publish:
uses: ./.github/workflows/build-conda-package.yaml
with:
recipe_dir: .conda/evpfft/gpu
secrets: inherit
36 changes: 28 additions & 8 deletions scripts/build-fierro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ show_help() {
echo " --kokkos_build_type=<serial|openmp|pthreads|cuda|hip>. Default is 'serial'"
echo " --build_action=<full-app|set-env|install-trilinos|install-hdf5|install-heffte|fierro>. Default is 'full-app'"
echo " --machine=<darwin|chicoma|linux|mac>. Default is 'linux'"
echo " --build_cores=<Integers greater than 0>. Default is set 1"
echo " --heffte_build_type=<fftw|cufft|rocfft>. Default is set 'fftw'"
echo " --build_cores=<Integers greater than 0>. Default is 1"
echo " --build_type=<source|anaconda>. Default is 'source'"
echo " --heffte_build_type=<fftw|cufft|rocfft>. Default is 'fftw'"
echo " --help: Display this help message"
echo " "
echo " "
Expand All @@ -22,6 +23,11 @@ show_help() {
echo " install-uncrustify builds and installs uncrustify. Only necessary for developers"
echo " fierro Generates CMake files and builds Fierro only (none of the dependencies)."
echo " "
echo " --build_type The build type of the applications. Specifies whether we're building from source or using pre-built anaconda libraries"
echo " "
echo " source builds Fierro and libraries from source codes."
echo " anaconda builds Fierro using anaconda pre-built libraries."
echo " "
echo " --solver Builds the desired solver to run. The default action is 'explicit'"
echo " "
echo " all builds both the explicit (non EVPFFT) and implicit solvers. Generally for debugging purposes"
Expand Down Expand Up @@ -63,12 +69,14 @@ machine="linux"
kokkos_build_type="serial"
heffte_build_type="fftw"
build_cores="1"
fierro_build_type="source"

# Define arrays of valid options
valid_build_action=("full-app" "set-env" "install-trilinos" "install-hdf5" "install-heffte" "install-uncrustify" "fierro")
valid_solver=("all" "explicit" "explicit-evpfft" "explicit-ls-evpfft" "implicit")
valid_kokkos_build_types=("serial" "openmp" "pthreads" "cuda" "hip")
valid_heffte_build_types=("fftw" "cufft" "rocfft")
valid_fierro_build_types=("source" "anaconda")
valid_machines=("darwin" "chicoma" "linux" "mac" "msu")

# Parse command line arguments
Expand Down Expand Up @@ -134,6 +142,16 @@ for arg in "$@"; do
return 1
fi
;;
--build_type=*)
option="${arg#*=}"
if [[ " ${valid_fierro_build_types[*]} " == *" $option "* ]]; then
fierro_build_type="$option"
else
echo "Error: Invalid --build_type specified."
show_help
return 1
fi
;;
--help)
show_help
return 1
Expand Down Expand Up @@ -184,12 +202,14 @@ source setup-env.sh ${machine} ${kokkos_build_type} ${build_cores}
# Next, do action based on args
if [ "$build_action" = "full-app" ]; then
source uncrustify-install.sh
source trilinos-install.sh ${kokkos_build_type} ${machine}
if [ "$solver" = "explicit-evpfft" ] || [ "${solver}" = "explicit-ls-evpfft" ]; then
source hdf5-install.sh
source heffte-install.sh ${heffte_build_type} ${machine}
if [ "$fierro_build_type" = "source" ]; then
source trilinos-install.sh ${kokkos_build_type} ${machine}
if [ "$solver" = "explicit-evpfft" ] || [ "${solver}" = "explicit-ls-evpfft" ]; then
source hdf5-install.sh
source heffte-install.sh ${heffte_build_type} ${machine}
fi
fi
source cmake_build.sh ${solver} ${heffte_build_type} ${kokkos_build_type}
source cmake_build.sh ${solver} ${heffte_build_type} ${kokkos_build_type} ${fierro_build_type}
elif [ "$build_action" = "install-trilinos" ]; then
source trilinos-install.sh ${kokkos_build_type} ${machine}
elif [ "$build_action" = "install-hdf5" ]; then
Expand All @@ -199,7 +219,7 @@ elif [ "$build_action" = "install-heffte" ]; then
elif [ "$build_action" = "install-uncrustify" ]; then
source uncrustify-install.sh
elif [ "$build_action" = "fierro" ]; then
source cmake_build.sh ${solver} ${heffte_build_type} ${kokkos_build_type}
source cmake_build.sh ${solver} ${heffte_build_type} ${kokkos_build_type} ${fierro_build_type}
else
echo "No build action, only setup the environment."
fi
Expand Down
4 changes: 3 additions & 1 deletion scripts/cmake_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
solver="${1}"
heffte_build_type="${2}"
kokkos_build_type="${3}"
fierro_build_type="${4}"

#inititialize submodules if they aren't downloaded
[ -d "${libdir}/Elements/elements" ] && echo "Elements submodule exists"
Expand All @@ -22,7 +23,8 @@ else
fi

# Install Elements
if [ ! -d "${ELEMENTS_INSTALL_DIR}/lib" ]; then
if { [ ! -d "${ELEMENTS_INSTALL_DIR}/lib" ] && [ "$fierro_build_type" = "source" ] ;}
then
echo "Installing Elements..."
cmake -D CMAKE_INSTALL_PREFIX="$ELEMENTS_INSTALL_DIR" -D Trilinos_DIR="${Trilinos_DIR}" -D Matar_ENABLE_KOKKOS=ON -D Matar_KOKKOS_PACKAGE=Trilinos -B "${ELEMENTS_BUILD_DIR}" -S "${ELEMENTS_SOURCE_DIR}"
make -C "${ELEMENTS_BUILD_DIR}" -j${FIERRO_BUILD_CORES}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
1 number of phases (nph)
1. 1. 1. RVE dimensions (delt)
* name and path of microstructure file (filetext)
/absolute/path/to/random_microstructure_8x8x8.txt
random_microstructure_8x8x8.txt
*INFORMATION ABOUT PHASE #1
0 igas(iph)
* name and path of single crystal files (filecryspl, filecrysel) (dummy if igas(iph)=1)
/absolute/path/to/example_plastic_parameters.txt
/absolute/path/to/example_elastic_parameters.txt
example_plastic_parameters.txt
example_elastic_parameters.txt
*INFORMATION ABOUT TEST CONDITIONS
* boundary conditions
0 1 1 iudot | flag for vel.grad.
Expand Down
8 changes: 4 additions & 4 deletions src/EVPFFT/scripts/build-scripts/build_evpfft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,21 @@ if [ "$build_fftw" -eq 1 ]; then
build_fftw_option="--build_fftw"
fi
HEFFTE_INSTALL_SCRIPT="$PARENT_DIR/scripts/install-scripts/install_heffte.sh"
source "$HEFFTE_INSTALL_SCRIPT" --heffte_build_type=$heffte_build_type --num_jobs=$num_jobs $build_fftw_option
###source "$HEFFTE_INSTALL_SCRIPT" --heffte_build_type=$heffte_build_type --num_jobs=$num_jobs $build_fftw_option

# --------building kokkos
KOKKOS_INSTALL_SCRIPT="$PARENT_DIR/scripts/install-scripts/install_kokkos.sh"
source "$KOKKOS_INSTALL_SCRIPT" --kokkos_build_type=$kokkos_build_type --num_jobs=$num_jobs
###source "$KOKKOS_INSTALL_SCRIPT" --kokkos_build_type=$kokkos_build_type --num_jobs=$num_jobs

# --------building hdf5
if [ "$build_hdf5" -eq 1 ]; then
HDF5_INSTALL_SCRIPT="$PARENT_DIR/scripts/install-scripts/install_hdf5.sh"
source "$HDF5_INSTALL_SCRIPT" --num_jobs=$num_jobs
### source "$HDF5_INSTALL_SCRIPT" --num_jobs=$num_jobs
fi

# --------building matar
MATAR_INSTALL_SCRIPT="$PARENT_DIR/scripts/install-scripts/install_matar.sh"
source "$MATAR_INSTALL_SCRIPT" --kokkos_build_type=$kokkos_build_type --num_jobs=$num_jobs
###source "$MATAR_INSTALL_SCRIPT" --kokkos_build_type=$kokkos_build_type --num_jobs=$num_jobs

# --------building EVPFFT
EVPFFT_SOURCE_DIR="$PARENT_DIR/src"
Expand Down
13 changes: 7 additions & 6 deletions src/EVPFFT/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ endif()
# HAVE_KOKKOS must be defined for MATAR to build Kokkos types
add_definitions(-DHAVE_KOKKOS=1)

if (NOT BUILD_EVPFFT_FIERRO)
if (USE_CUFFT)
find_package(CUDAToolkit REQUIRED)
endif()
find_package(Kokkos REQUIRED)
endif()
#if (NOT BUILD_EVPFFT_FIERRO)
#if (USE_CUFFT)
# find_package(CUDAToolkit REQUIRED)
#endif()
# find_package(Kokkos REQUIRED)
#endif()
find_package(Kokkos REQUIRED)
find_package(MPI REQUIRED)
find_package(Heffte REQUIRED)
# HDF5
Expand Down

0 comments on commit 0dce9a0

Please sign in to comment.