Skip to content

Commit

Permalink
Merge branch 'main' into enable-gnu-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mhaseeb123 authored Nov 30, 2023
2 parents 9d9f3fa + 4bb2e94 commit 3ac0c5a
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 191 deletions.
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

43 changes: 20 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ endif()

# cmake min required
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(nvstdpar)
project(nvstdpar LANGUAGES CXX CUDA)
project(hpcpp LANGUAGES CXX CUDA)

# in source build warning
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
Expand All @@ -45,16 +44,16 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/external/")

# Set a default build type if none was specified
set(NVSTDPAR_BUILD_TYPE "RelWithDebInfo")
set(HPCPP_BUILD_TYPE "RelWithDebInfo")

# set the build type
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(
STATUS
"${BoldCyan}Setting build type to '${NVSTDPAR_BUILD_TYPE}' as none was specified.${ColourReset}"
"${BoldCyan}Setting build type to '${HPCPP_BUILD_TYPE}' as none was specified.${ColourReset}"
)
set(CMAKE_BUILD_TYPE
"${NVSTDPAR_BUILD_TYPE}"
"${HPCPP_BUILD_TYPE}"
CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
Expand All @@ -69,7 +68,7 @@ set(GCC_EXPECTED_VERSION 11.2)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_EXPECTED_VERSION)
message(
FATAL_ERROR
"GCC: nvstdpar requires GCC v${GCC_EXPECTED_VERSION} or higher to build but found v${CMAKE_CXX_COMPILER_VERSION}"
"GCC: hpcpp requires GCC v${GCC_EXPECTED_VERSION} or higher to build but found v${CMAKE_CXX_COMPILER_VERSION}"
)
endif()

Expand Down Expand Up @@ -127,8 +126,7 @@ cpmaddpackage(
GITHUB_REPOSITORY
NVIDIA/stdexec
GIT_TAG
main # This will always pull the latest code from the `main` branch. You may
# also use a specific release version or tag
main
OPTIONS
"STDEXEC_ENABLE_CUDA ON"
"STDEXEC_BUILD_EXAMPLES OFF"
Expand All @@ -141,9 +139,7 @@ cpmaddpackage(
mdspan
GITHUB_REPOSITORY
kokkos/mdspan
GIT_TAG
stable# This will always pull the latest code from the `main` branch. You may
# also use a specific release version or tag
stable
)

cpmaddpackage(
Expand All @@ -152,8 +148,7 @@ cpmaddpackage(
GITHUB_REPOSITORY
fmtlib/fmt
GIT_TAG
master# This will always pull the latest code from the `main` branch. You may
# also use a specific release version or tag
master
)

cpmaddpackage(
Expand All @@ -162,8 +157,16 @@ cpmaddpackage(
GITHUB_REPOSITORY
weilewei/mdspan_formatter
GIT_TAG
main# This will always pull the latest code from the `main` branch. You may
# also use a specific release version or tag
main
)

cpmaddpackage(
NAME
argparse
GITHUB_REPOSITORY
mhaseeb123/argparse
GIT_TAG
master
)

add_library(hpcpp-core INTERFACE)
Expand All @@ -173,6 +176,7 @@ target_link_libraries(hpcpp-core INTERFACE
mdspan
fmt
mdspan_formatter
argparse
)

# stdpar and openmp
Expand Down Expand Up @@ -219,16 +223,9 @@ endif()
# Add sub-directories
# ##############################################################################

# ----------------------------------------------------------------------------------------#
# externals
# ----------------------------------------------------------------------------------------#

message(STATUS "Adding externals...")
add_subdirectory(externals)

# ----------------------------------------------------------------------------------------#
# apps
# ----------------------------------------------------------------------------------------#

message(STATUS "Adding nvstdpar apps...")
message(STATUS "Adding hpcpp apps...")
add_subdirectory(apps)
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# hpcpp

Standard C++26 (single-source) HPC proxy apps that run on CPUs and GPUs (powered by `nv-std::execution`).

## Build

```bash
git clone --recursive https://github.com/NERSC/hpcpp.git
cd nvstdpar ; mkdir build ; cd build
cd hpcpp; mkdir build ; cd build
ml nvhpc/23.7 cmake 3.24

# enable GPU support by setting -DSTDPAR=gpu (default)
Expand All @@ -18,7 +19,7 @@ cmake .. -DSTDPAR=<gpu/multicore> ; make -j
You can also use the pre-configured `localrc` file included in this repo. To use it, run:

```bash
export GCCLOCALRC=/path/to/nvstdpar/scripts/pm-localrc/localrc
export GCCLOCALRC=/path/to/hpcpp/scripts/pm-localrc/localrc
```

**Note**: Please uncomment the following line in `apps/fft/CMakeLists.txt` if using `nvc++` version < 23.7?
Expand All @@ -31,7 +32,7 @@ export GCCLOCALRC=/path/to/nvstdpar/scripts/pm-localrc/localrc
## Run Apps

```bash
cd nvstdpar/build
cd hpcpp/build
srun -n 1 -N 1 -G <> -A <acct> -t 30 -C <cpu/gpu> ./apps/<appname>/<appname> [ARGS]
```

Expand Down
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ message(STATUS "Adding heat-equation...")
add_subdirectory(heat-equation)

# ----------------------------------------------------------------------------------------#
# Add MDSPAN + nvstdpar demo
# Add MDSPAN + hpcpp demo
# ----------------------------------------------------------------------------------------#

message(STATUS "Adding mdspan-stdpar...")
Expand Down
4 changes: 2 additions & 2 deletions apps/comm-study/comm-study-no-senders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "commons.hpp"
//
// Build and run on Perlmutter using
// ml nvhpc/23.1 ; nvc++ -stdpar=gpu -std=c++20 -o nvstdpar.out
// ./nvstdpar_nosenders.cpp && nsys profile --stats=true ./nvstdpar.out
// ml nvhpc/23.1 ; nvc++ -stdpar=gpu -std=c++20 -o hpcpp.out
// ./hpcpp_nosenders.cpp && nsys profile --stats=true ./hpcpp.out
//

using T = double;
Expand Down
154 changes: 0 additions & 154 deletions externals/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion externals/argparse
Submodule argparse deleted from 977062
1 change: 0 additions & 1 deletion externals/magic_enum
Submodule magic_enum deleted from d67973

0 comments on commit 3ac0c5a

Please sign in to comment.