-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding CUDA and OPENMP to LAMMPS experiment class (#570)
* progress on lammps * venado configs * lammps cuda * Fix super invocations * Fix mpi * cufft * venado specs * changing blas name, allowing no extra args * adding updated dryruns * removing duplicate dryrun --------- Co-authored-by: august-knox <[email protected]> Co-authored-by: Riyaz Haque <[email protected]> Co-authored-by: Riyaz Haque <[email protected]>
- Loading branch information
1 parent
90e025f
commit cbe1579
Showing
5 changed files
with
112 additions
and
19 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
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,15 @@ | ||
# Copyright 2023 Lawrence Livermore National Security, LLC and other | ||
# Benchpark Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from spack.package import * | ||
from spack.pkg.builtin.kokkos import Kokkos as BuiltinKokkos | ||
|
||
|
||
class Kokkos(BuiltinKokkos): | ||
flag_handler = build_system_flags | ||
|
||
def setup_build_environment(self, env): | ||
if "+cuda" in self.spec: | ||
env.set("NVCC_APPEND_FLAGS", "-allow-unsupported-compiler") |
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 |
---|---|---|
|
@@ -9,13 +9,17 @@ | |
|
||
class Lammps(BuiltinLammps): | ||
|
||
depends_on("kokkos+openmp", when="+openmp") | ||
depends_on("kokkos+openmp cxxstd=17", when="+openmp") | ||
depends_on("kokkos+rocm", when="+rocm") | ||
depends_on("kokkos+cuda", when="+cuda") | ||
depends_on("[email protected] +cuda cxxstd=17", when="+cuda") | ||
|
||
conflicts("+rocm", when="+cuda") | ||
conflicts("+cuda", when="+rocm") | ||
|
||
def setup_run_environment(self, env): | ||
flag_handler = build_system_flags | ||
|
||
super(BuiltinLammps, self).setup_run_environment(env) | ||
def setup_run_environment(self, env): | ||
super().setup_run_environment(env) | ||
|
||
if self.compiler.extra_rpaths: | ||
for rpath in self.compiler.extra_rpaths: | ||
|
@@ -24,7 +28,13 @@ def setup_run_environment(self, env): | |
def setup_build_environment(self, env): | ||
super().setup_build_environment(env) | ||
|
||
spec = self.spec | ||
if "+mpi" in spec: | ||
if spec["mpi"].extra_attributes and "ldflags" in spec["mpi"].extra_attributes: | ||
env.append_flags("LDFLAGS", spec["mpi"].extra_attributes["ldflags"]) | ||
if "+cuda" in self.spec: | ||
env.set("NVCC_APPEND_FLAGS", "-allow-unsupported-compiler") | ||
|
||
def cmake_args(self): | ||
args = super().cmake_args() | ||
args.append(f"-DMPI_CXX_LINK_FLAGS='{self.spec['mpi'].libs.ld_flags}'") | ||
args.append(f"-DMPI_C_COMPILER='{self.spec['mpi'].mpicc}'") | ||
args.append(f"-DMPI_CXX_COMPILER={self.spec['mpi'].mpicxx}") | ||
|
||
return args |