Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding openmp_target specs to lassen jobs #1270

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion .gitlab/lassen-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ clang_9_gcc_8:

clang_11_0_0:
variables:
SPEC: "+openmp %[email protected]"
SPEC: "+openmp+openmp_target cxxflags=-std=c++14 %[email protected]"
extends: .build_and_test_on_lassen

gcc_8_3_1:
Expand Down
4 changes: 3 additions & 1 deletion scripts/gitlab/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ fi
# Build Directory
if [[ -z ${build_root} ]]
then
build_root=$(pwd)
build_root="/dev/shm$(pwd)"
else
build_root="/dev/shm${build_root}"
fi

build_dir="${build_root}/build_${hostconfig//.cmake/}"
Expand Down
13 changes: 12 additions & 1 deletion scripts/spack_packages/raja/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Raja(CMakePackage, CudaPackage, ROCmPackage):
version('0.4.0', tag='v0.4.0', submodules="True")

variant('openmp', default=True, description='Build OpenMP backend')
variant('openmp_target', default=False, description='Build with OpenMP support')
variant('shared', default=False, description='Build Shared Libs')
variant('libcpp', default=False, description='Uses libc++ instead of libstdc++')
variant('tests', default='basic', values=('none', 'basic', 'benchmarks'),
Expand All @@ -105,7 +106,11 @@ class Raja(CMakePackage, CudaPackage, ROCmPackage):
when='cuda_arch={0}'.format(sm_))

conflicts('+openmp', when='+rocm')

conflicts('~openmp', when='+openmp_target', msg='OpenMP target requires OpenMP')
# Is this true? ############
conflicts('+cuda', when='+rocm')
conflicts('+rocm', when='+openmp_target', msg='Cant support both rocm and openmp device backends at once')
############################
phases = ['hostconfig', 'cmake', 'build', 'install']

def _get_sys_type(self, spec):
Expand Down Expand Up @@ -340,9 +345,15 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None):

# shared vs static libs
cfg.write(cmake_cache_option("BUILD_SHARED_LIBS","+shared" in spec))
cfg.write(cmake_cache_option("ENABLE_OPENMP","+openmp" in spec))
cfg.write(cmake_cache_option("RAJA_ENABLE_OPENMP","+openmp" in spec))
cfg.write(cmake_cache_option("RAJA_ENABLE_TARGET_OPENMP","+openmp_target" in spec))
cfg.write(cmake_cache_option("RAJA_ENABLE_DESUL_ATOMICS","+desul" in spec))

if "+openmp_target" in spec:
cfg.write(cmake_cache_string("OpenMP_CXX_FLAGS", "-fopenmp;-fopenmp-targets=nvptx64-nvidia-cuda"))
cfg.write(cmake_cache_option("ENABLE_CUDA", False))

if "+desul" in spec:
cfg.write(cmake_cache_string("BLT_CXX_STD","c++14"))
if "+cuda" in spec:
Expand Down