-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f19898f
commit 83ae52b
Showing
22 changed files
with
503 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
|
||
#pragma once | ||
|
||
#include <picongpu/simulation_types.hpp> | ||
|
||
namespace picongpu | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
################################################### | ||
# translate PIConGPU backend names into CMake Flags | ||
################################################### | ||
|
||
get_backend_flags() | ||
{ | ||
backend_cfg=(${1//:/ }) | ||
num_options="${#backend_cfg[@]}" | ||
if [ $num_options -gt 2 ] ; then | ||
echo "-b|--backend must be contain 'backend:arch' or 'backend'" >&2 | ||
exit 1 | ||
fi | ||
if [ "${backend_cfg[0]}" == "cuda" ] ; then | ||
result+=" -Dalpaka_ACC_GPU_CUDA_ENABLE=ON -Dalpaka_ACC_GPU_CUDA_ONLY_MODE=ON" | ||
if [ $num_options -eq 2 ] ; then | ||
result+=" -DCMAKE_CUDA_ARCHITECTURES=\"${backend_cfg[1]}\"" | ||
else | ||
result+=" -DCMAKE_CUDA_ARCHITECTURES=52" | ||
fi | ||
elif [ "${backend_cfg[0]}" == "omp2b" ] ; then | ||
result+=" -Dalpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE=ON" | ||
if [ $num_options -eq 2 ] ; then | ||
result+=" -DPMACC_CPU_ARCH=\"${backend_cfg[1]}\"" | ||
fi | ||
elif [ "${backend_cfg[0]}" == "serial" ] ; then | ||
result+=" -Dalpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE=ON" | ||
if [ $num_options -eq 2 ] ; then | ||
result+=" -DPMACC_CPU_ARCH=\"${backend_cfg[1]}\"" | ||
fi | ||
elif [ "${backend_cfg[0]}" == "tbb" ] ; then | ||
result+=" -Dalpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE=ON" | ||
if [ $num_options -eq 2 ] ; then | ||
result+=" -DPMACC_CPU_ARCH=\"${backend_cfg[1]}\"" | ||
fi | ||
elif [ "${backend_cfg[0]}" == "threads" ] ; then | ||
result+=" -Dalpaka_ACC_CPU_B_SEQ_T_THREADS_ENABLE=ON" | ||
if [ $num_options -eq 2 ] ; then | ||
result+=" -DPMACC_CPU_ARCH=\"${backend_cfg[1]}\"" | ||
fi | ||
elif [ "${backend_cfg[0]}" == "hip" ] ; then | ||
result+=" -Dalpaka_ACC_GPU_HIP_ENABLE=ON -Dalpaka_ACC_GPU_HIP_ONLY_MODE=ON" | ||
if [ $num_options -eq 2 ] ; then | ||
result+=" -DGPU_TARGETS=\"${backend_cfg[1]}\"" | ||
else | ||
# If no architecture is given build for Radeon VII or MI50/60. | ||
result+=" -DGPU_TARGETS=gfx906" | ||
fi | ||
else | ||
echo "unsupported backend given '$1'" >&2 | ||
exit 1 | ||
fi | ||
|
||
echo "$result" | ||
exit 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
export code_DIR=$CI_PROJECT_DIR | ||
source $code_DIR/share/ci/backendFlags.sh | ||
|
||
# the default build type is Release | ||
# if neccesary, you can rerun the pipeline with another build type-> https://docs.gitlab.com/ee/ci/pipelines.html#manually-executing-pipelines | ||
# to change the build type, you must set the environment variable PIC_BUILD_TYPE | ||
if [[ ! -v PIC_BUILD_TYPE ]] ; then | ||
PIC_BUILD_TYPE=Release ; | ||
fi | ||
|
||
if [[ "$CI_RUNNER_TAGS" =~ .*cpuonly.* ]] ; then | ||
# In cases where the compile-only job is executed on a GPU runner but with different kinds of accelerators | ||
# we need to reset the variables to avoid compiling for the wrong architecture and accelerator. | ||
unset CI_GPUS | ||
unset CI_GPU_ARCH | ||
fi | ||
|
||
if [ -n "$CI_GPUS" ] ; then | ||
# select randomly a device if multiple exists | ||
# CI_GPUS is provided by the gitlab CI runner | ||
SELECTED_DEVICE_ID=$((RANDOM%CI_GPUS)) | ||
export HIP_VISIBLE_DEVICES=$SELECTED_DEVICE_ID | ||
export CUDA_VISIBLE_DEVICES=$SELECTED_DEVICE_ID | ||
echo "selected device '$SELECTED_DEVICE_ID' of '$CI_GPUS'" | ||
else | ||
echo "No GPU device selected because environment variable CI_GPUS is not set." | ||
fi | ||
|
||
if [[ "$PIC_BACKEND" =~ hip.* ]] ; then | ||
if [ -z "$CI_GPU_ARCH" ] ; then | ||
# In case the CI runner is not providing a GPU architecture e.g. a CPU runner set the architecture | ||
# to Radeon VII or MI50/60. | ||
export GPU_TARGETS="gfx906" | ||
fi | ||
export PIC_CMAKE_ARGS="$PIC_CMAKE_ARGS -DGPU_TARGETS=$GPU_TARGETS" | ||
fi | ||
|
||
################################################### | ||
# cmake config builder | ||
################################################### | ||
|
||
PIC_CONST_ARGS="" | ||
PIC_CONST_ARGS="${PIC_CONST_ARGS} -DCMAKE_BUILD_TYPE=${PIC_BUILD_TYPE}" | ||
CMAKE_ARGS="${PIC_CONST_ARGS} ${PIC_CMAKE_ARGS} -DCMAKE_CXX_COMPILER=${CXX_VERSION} -DBOOST_ROOT=/opt/boost/${BOOST_VERSION}" | ||
|
||
# check and activate if clang should be used as CUDA device compiler | ||
if [ -n "$CI_CLANG_AS_CUDA_COMPILER" ] ; then | ||
export PATH="$(agc-manager -b cuda)/bin:$PATH" | ||
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CUDA_COMPILER=${CXX_VERSION}" | ||
fi | ||
|
||
alpaka_backend=$(get_backend_flags ${PIC_BACKEND}) | ||
CMAKE_ARGS="$CMAKE_ARGS $alpaka_backend" | ||
|
||
################################################### | ||
# build and run unit tests | ||
################################################### | ||
|
||
# adjust number of parallel builds to avoid out of memory errors | ||
# PIC_BUILD_REQUIRED_MEM_BYTES is a configured variable in the CI web interface | ||
PIC_PARALLEL_BUILDS=$(($CI_RAM_BYTES_TOTAL/$PIC_BUILD_REQUIRED_MEM_BYTES)) | ||
|
||
# limit to number of available cores | ||
if [ $PIC_PARALLEL_BUILDS -gt $CI_CPUS ] ; then | ||
PIC_PARALLEL_BUILDS=$CI_CPUS | ||
fi | ||
|
||
# CI_MAX_PARALLELISM is a configured variable in the CI web interface | ||
if [ $PIC_PARALLEL_BUILDS -gt $CI_MAX_PARALLELISM ] ; then | ||
PIC_PARALLEL_BUILDS=$CI_MAX_PARALLELISM | ||
fi | ||
echo -e "\033[0;32m///////////////////////////////////////////////////" | ||
echo "PIC_BUILD_REQUIRED_MEM_BYTES-> ${PIC_BUILD_REQUIRED_MEM_BYTES}" | ||
echo "CI_RAM_BYTES_TOTAL -> ${CI_RAM_BYTES_TOTAL}" | ||
echo "CI_CPUS -> ${CI_CPUS}" | ||
echo "CI_MAX_PARALLELISM -> ${CI_MAX_PARALLELISM}" | ||
echo "number of processor threads -> $(nproc)" | ||
echo "number of parallel builds -> $PIC_PARALLEL_BUILDS" | ||
echo "cmake version -> $(cmake --version | head -n 1)" | ||
echo "build directory -> $(pwd)" | ||
echo "CMAKE_ARGS -> ${CMAKE_ARGS}" | ||
echo "accelerator -> ${PIC_BACKEND}" | ||
echo "input set -> ${PIC_TEST_CASE_FOLDER}" | ||
echo -e "/////////////////////////////////////////////////// \033[0m \n\n" | ||
|
||
|
||
## run unit tests | ||
export unitTest_folder=$HOME/buildPICUnitTest | ||
mkdir -p $unitTest_folder | ||
cd $unitTest_folder | ||
cmake $CMAKE_ARGS $code_DIR/share/picongpu/unit | ||
make -j $PIC_PARALLEL_BUILDS | ||
# execute on one device | ||
ctest -V |
Oops, something went wrong.