-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project name KokkosRemote -> KokkosRemoteSpaces, adds sample project …
…with external KRS dep
- Loading branch information
Showing
20 changed files
with
133 additions
and
42 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
add_executable(misslatency misslatency.cpp) | ||
add_executable(misslatency_partitioned misslatency_partitioned.cpp) | ||
target_link_libraries(misslatency PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(misslatency_partitioned PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(misslatency PRIVATE Kokkos::kokkosremotespaces) | ||
target_link_libraries(misslatency_partitioned PRIVATE Kokkos::kokkosremotespaces) |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_executable(poissonaccess poissonaccess.cpp) | ||
target_link_libraries(poissonaccess PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(poissonaccess PRIVATE Kokkos::kokkosremotespaces) |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_executable(randomaccess randomaccess.cpp) | ||
target_link_libraries(randomaccess PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(randomaccess PRIVATE Kokkos::kokkosremotespaces) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
add_executable(cgsolve cgsolve.cpp) | ||
target_link_libraries(cgsolve PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(cgsolve PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(cgsolve PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_compile_definitions(cgsolve PRIVATE KRS_ENABLE_NVSHMEM_PTR) |
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,8 @@ | ||
cmake_minimum_required(VERSION 3.25) | ||
project(MyProject) | ||
|
||
find_package(KokkosRemoteSpaces REQUIRED) | ||
|
||
add_executable(project project.cpp) | ||
target_link_libraries(project PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(project PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) |
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,30 @@ | ||
//@HEADER | ||
// ************************************************************************ | ||
// | ||
// Kokkos v. 4.0 | ||
// Copyright (2022) National Technology & Engineering | ||
// Solutions of Sandia, LLC (NTESS). | ||
// | ||
// Under the terms of Contract DE-NA0003525 with NTESS, | ||
// the U.S. Government retains certain rights in this software. | ||
// | ||
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://kokkos.org/LICENSE for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
// Contact: Jan Ciesko (jciesko@sandia.gov) | ||
// | ||
//@HEADER | ||
|
||
#include <Kokkos_RemoteSpaces.hpp> | ||
#include <project.hpp> | ||
|
||
int main(int argc, char *argv[]) { | ||
comm_init(argc, argv); | ||
Kokkos::initialize(argc, argv); | ||
{ | ||
// Your application code here | ||
} | ||
Kokkos::finalize(); | ||
comm_fini(); | ||
} |
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,53 @@ | ||
//@HEADER | ||
// ************************************************************************ | ||
// | ||
// Kokkos v. 4.0 | ||
// Copyright (2022) National Technology & Engineering | ||
// Solutions of Sandia, LLC (NTESS). | ||
// | ||
// Under the terms of Contract DE-NA0003525 with NTESS, | ||
// the U.S. Government retains certain rights in this software. | ||
// | ||
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://kokkos.org/LICENSE for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
// Contact: Jan Ciesko (jciesko@sandia.gov) | ||
// | ||
//@HEADER | ||
|
||
void comm_init(int argc, char* argv[]) { | ||
int mpi_thread_level_available; | ||
int mpi_thread_level_required = MPI_THREAD_MULTIPLE; | ||
|
||
#ifdef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL | ||
mpi_thread_level_required = MPI_THREAD_SINGLE; | ||
#endif | ||
|
||
MPI_Init_thread(&argc, &argv, mpi_thread_level_required, | ||
&mpi_thread_level_available); | ||
assert(mpi_thread_level_available >= mpi_thread_level_required); | ||
|
||
#ifdef KRS_ENABLE_SHMEMSPACE | ||
shmem_init_thread(mpi_thread_level_required, &mpi_thread_level_available); | ||
assert(mpi_thread_level_available >= mpi_thread_level_required); | ||
#endif | ||
|
||
#ifdef KRS_ENABLE_NVSHMEMSPACE | ||
MPI_Comm mpi_comm; | ||
nvshmemx_init_attr_t attr; | ||
mpi_comm = MPI_COMM_WORLD; | ||
attr.mpi_comm = &mpi_comm; | ||
nvshmemx_init_attr(NVSHMEMX_INIT_WITH_MPI_COMM, &attr); | ||
#endif | ||
} | ||
|
||
void comm_fini() { | ||
#ifdef KRS_ENABLE_SHMEMSPACE | ||
shmem_finalize(); | ||
#endif | ||
#ifdef KRS_ENABLE_NVSHMEMSPACE | ||
nvshmem_finalize(); | ||
#endif | ||
MPI_Finalize(); | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
add_executable(mpi_heat3d heat3d.cpp) | ||
target_link_libraries(mpi_heat3d PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(mpi_heat3d PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(mpi_heat3d PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
add_executable(opt_rma_heat3d heat3d.cpp) | ||
target_link_libraries(opt_rma_heat3d PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(opt_rma_heat3d PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(opt_rma_heat3d PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_compile_definitions(opt_rma_heat3d PRIVATE KRS_ENABLE_NVSHMEM_PTR) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
add_executable(partitioned_heat3d heat3d.cpp) | ||
target_link_libraries(partitioned_heat3d PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(partitioned_heat3d PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(partitioned_heat3d PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_compile_definitions(partitioned_heat3d PRIVATE KRS_ENABLE_NVSHMEM_PTR) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
add_executable(rma_heat3d heat3d.cpp) | ||
target_link_libraries(rma_heat3d PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(rma_heat3d PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(rma_heat3d PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_compile_definitions(rma_heat3d PRIVATE KRS_ENABLE_NVSHMEM_PTR) |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
add_executable(matvec_multi matvec.cpp) | ||
target_link_libraries(matvec_multi PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(matvec_multi PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(matvec_multi PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
add_executable(matvec_single matvec.cpp) | ||
target_link_libraries(matvec_single PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(matvec_single PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(matvec_single PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
add_executable(shift_multi vectorshift.cpp) | ||
target_link_libraries(shift_multi PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(shift_multi PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(shift_multi PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
add_executable(shift_single vectorshift.cpp) | ||
target_link_libraries(shift_single PRIVATE Kokkos::kokkosremote) | ||
target_link_libraries(shift_single PRIVATE Kokkos::kokkosremotespaces) | ||
target_include_directories(shift_single PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
|
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