Skip to content

Commit

Permalink
Merge pull request #669 from lukemartinlogan/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lukemartinlogan authored Feb 8, 2024
2 parents 84efb69 + f1a1097 commit 462b601
Show file tree
Hide file tree
Showing 20 changed files with 390 additions and 324 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build_and_push_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Build and push deps.Dockerfile
# uses: docker/build-push-action@v4
# with:
# context: ./
# file: ./docker/deps.Dockerfile
# builder: ${{ steps.buildx.outputs.name }}
# push: true
# tags: hdfgroup/hermes-deps:latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push deps.Dockerfile
uses: docker/build-push-action@v4
with:
context: ./
file: ./docker/deps.Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: hdfgroup/hermes-deps:latest
# - name: Build and push dev.Dockerfile
# uses: docker/build-push-action@v4
# with:
Expand Down
48 changes: 34 additions & 14 deletions CMake/HermesConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@
# Hermes_LIBRARIES, the libraries to link against to use the Hermes library
# Hermes_LIBRARY_DIRS, the directory where the Hermes library is found.

#-----------------------------------------------------------------------------
# Define constants
#-----------------------------------------------------------------------------
set(HERMES_VERSION_MAJOR @HERMES_VERSION_MAJOR@)
set(HERMES_VERSION_MINOR @HERMES_VERSION_MINOR@)
set(HERMES_VERSION_PATCH @HERMES_VERSION_PATCH@)

set(BUILD_MPI_TESTS @BUILD_MPI_TESTS@)
set(BUILD_OpenMP_TESTS @BUILD_OpenMP_TESTS@)
set(HERMES_ENABLE_COMPRESS @HERMES_ENABLE_COMPRESS@)
set(HERMES_ENABLE_ENCRYPT @HERMES_ENABLE_ENCRYPT@)

#-----------------------------------------------------------------------------
# Find hermes header
#-----------------------------------------------------------------------------
find_path(
Hermes_INCLUDE_DIR
hermes/hermes_types.h
Expand All @@ -20,20 +35,24 @@ endif()
get_filename_component(Hermes_DIR ${Hermes_INCLUDE_DIR} PATH)

#-----------------------------------------------------------------------------
# Find all packages needed by Hermes
# Find hermes library
#-----------------------------------------------------------------------------
find_library(
Hermes_LIBRARY
NAMES hrun_client hrun_server
HINTS ENV LD_LIBRARY_PATH ENV PATH
Hermes_LIBRARY
NAMES hrun_client
HINTS ENV LD_LIBRARY_PATH ENV PATH
)
if (NOT Hermes_LIBRARY)
message(STATUS "FindHermes: Could not find libhrun_client.so")
set(Hermes_FOUND FALSE)
set(Hermes_FOUND OFF)
message(STATUS "LIBS: $ENV{LD_LIBRARY_PATH}")
return()
endif()

#-----------------------------------------------------------------------------
# Find all packages needed by Hermes
#-----------------------------------------------------------------------------

# HermesShm
find_package(HermesShm CONFIG REQUIRED)
message(STATUS "found hermes_shm.h at ${HermesShm_INCLUDE_DIRS}")
Expand All @@ -60,15 +79,11 @@ endif()

# Cereal
find_package(cereal REQUIRED)
if(cereal)
message(STATUS "found cereal")
endif()
message(STATUS "found cereal")

# Boost
find_package(Boost REQUIRED COMPONENTS regex system filesystem fiber REQUIRED)
if (Boost_FOUND)
message(STATUS "found boost at ${Boost_INCLUDE_DIRS}")
endif()
message(STATUS "found boost at ${Boost_INCLUDE_DIRS}")

# Thallium
find_package(thallium CONFIG REQUIRED)
Expand All @@ -83,6 +98,7 @@ set(Hermes_LIBRARY_DIR "")
get_filename_component(Hermes_LIBRARY_DIRS ${Hermes_LIBRARY} PATH)
# Set uncached variables as per standard.
set(Hermes_FOUND ON)
# Set Hermes dirs
set(Hermes_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${Hermes_INCLUDE_DIR})
set(Hermes_LIBRARIES
${HermesShm_LIBRARIES}
Expand All @@ -92,9 +108,13 @@ set(Hermes_LIBRARIES
thallium
hermes
${Boost_LIBRARIES} ${Hermes_LIBRARY})
set(Hermes_LIBRARY_DIRS ${HermeShm_LIBRARY_DIRS})
# Set Hermes client dirs (equal to Hermes dirs)
set(Hermes_CLIENT_LIBRARIES ${Hermes_LIBRARIES})
set(Hermes_CLIENT_LIBRARY_DIRS ${Hermes_LIBRARY_DIRS})
# Set Hermes runtime dirs
set(Hermes_RUNTIME_LIBRARIES
${Hermes_CLIENT_LIBRARIES}
hrun_runtime
${Boost_LIBRARIES})
set(Hermes_RUNTIME_DEPS "")
hrun_runtime)
set(Hermes_RUNTIME_LIBRARY_DIRS ${HermeShm_LIBRARY_DIRS})
set(Hermes_RUNTIME_DEPS "")
30 changes: 28 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
cmake_minimum_required(VERSION 3.10)
project(hermes)

#-----------------------------------------------------------------------------
# Define Constants
#-----------------------------------------------------------------------------
set(HERMES_VERSION_MAJOR 1)
set(HERMES_VERSION_MINOR 1)
set(HERMES_VERSION_PATCH 0)

#-----------------------------------------------------------------------------
# Define Options
#-----------------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" ON)
option(BUILD_MPI_TESTS "Build tests which depend on MPI" ON)
option(BUILD_OpenMP_TESTS "Build tests which depend on OpenMP" ON)
option(HERMES_ENABLE_COVERAGE "Check how well tests cover code" OFF)
option(HERMES_ENABLE_DOXYGEN "Check how well the code is documented" OFF)
option(HERMES_ENABLE_DOXYGEN "Check how well the code is documented" ON)
option(HERMES_REMOTE_DEBUG "Enable remote debug mode on hrun" OFF)

option(HERMES_ENABLE_POSIX_ADAPTER "Build the Hermes POSIX adapter." ON)
Expand Down Expand Up @@ -48,8 +55,27 @@ if(NOT HERMES_EXPORTED_TARGETS)
set(HERMES_EXPORTED_TARGETS "hrun-targets")
endif()


#-----------------------------------------------------------------------------
# Documentation
#-----------------------------------------------------------------------------
#if (HERMES_ENABLE_DOXYGEN)
# include(UseDoxygenDoc)
#
# add_doxygen_doc(
# BUILD_DIR
# ${CMAKE_CURRENT_BINARY_DIR}/_build
# DOXY_FILE
# ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
# TARGET_NAME
# dox
# COMMENT
# "HTML documentation"
# )
#endif()

#-----------------------------------------------------------------------------
# Coverage
# Code Coverage
#-----------------------------------------------------------------------------
if(HERMES_ENABLE_COVERAGE)
set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage --coverage" CACHE STRING
Expand Down
46 changes: 6 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,18 @@
# Hermes

Hermes is a heterogeneous-aware, multi-tiered, dynamic, and distributed I/O buffering system that aims to significantly accelerate I/O performance. See the [official site](http://www.cs.iit.edu/~scs/assets/projects/Hermes/Hermes.html) for more information. For design documents, architecture description, performance data, and individual component design, see the [wiki](https://grc.iit.edu/docs/category/hermes).
Hermes is a heterogeneous-aware, multi-tiered, dynamic, and distributed I/O
buffering system that aims to significantly accelerate I/O performance.
See the [official site](http://www.cs.iit.edu/~scs/assets/projects/Hermes/Hermes.html) for more information. For design documents,
architecture description, performance data, and individual component design,
see the [wiki](https://grc.iit.edu/docs/category/hermes).

![Build](https://github.com/HDFGroup/hermes/workflows/GitHub%20Actions/badge.svg)

[![Coverage Status](https://coveralls.io/repos/github/HDFGroup/hermes/badge.svg?branch=master)](https://coveralls.io/github/HDFGroup/hermes?branch=master)

## Dependencies

* A C++ compiler that supports C++ 17.
* [Thallium](https://mochi.readthedocs.io/en/latest/installing.html) - RPC library for HPC. Use a version greater than `0.5` for RoCE support.
* [yaml-cpp](https://github.com/jbeder/yaml-cpp) - YAML file parser
* HDF5 1.14.0 if compiling with VFD
* MPI-IO adapter only tested with MPICH and OpenMPI.

## Building

### Spack

[Spack](https://spack.io/) is the easiest way to get Hermes and all its dependencies installed.

```bash
# set location of hermes_file_staging
git clone https://github.com/HDFGroup/hermes --recurse-submodules
spack repo add ${HERMES_REPO}/ci/hermes
# Master should include all stable updates
spack install hermes@master
```

### CMake

Hermes makes use of the CMake build system and requires an out of source build.

Hermes has a corresponding package, hermes_shm, which has all the same dependencies as Hermes.
```
spack install hermes_shm
spack load hermes_shm
```

You can then build Hermes with CMake:
```
cd /path/to/hermes
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Relase -DCMAKE_INSTALL_PREFIX=...
make -j8
make install
```
Read the guide on [Building Hermes](https://grc.iit.edu/docs/hermes/building-hermes).

## Contributing

Expand Down
36 changes: 19 additions & 17 deletions ci/hermes/packages/hermes/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,25 @@ class Hermes(CMakePackage):
# Common across hermes_shm and hermes
variant('mpiio', default=True, description='Enable MPI I/O adapter')
variant('stdio', default=True, description='Enable STDIO adapter')
variant('debug', default=False, description='Build shared libraries')
variant('vfd', default=False, description='Enable HDF5 VFD')
variant('ares', default=False, description='Enable full libfabric install')
variant('only_verbs', default=False, description='Only verbs')
variant('debug', default=False, description='Build shared libraries')
variant('zmq', default=False, description='Build ZeroMQ tests')
variant('adios', default=False, description='Build Adios tests')
variant('encrypt', default=False, description='Build Adios tests')
variant('compress', default=False, description='Build Adios tests')

depends_on('[email protected]')
depends_on('[email protected]')
depends_on('mpi')
depends_on('cereal')
depends_on('yaml-cpp')
depends_on('libaio')
depends_on('doxygen') # @1.9.3
depends_on('[email protected]: +context +fiber +filesystem +system +atomic +chrono +serialization +signals +pic +regex')
depends_on('libfabric fabrics=sockets,tcp,udp,verbs,mlx,rxm,rxd,shm',
when='+ares')
depends_on('libfabric fabrics=verbs',
when='+only_verbs')
depends_on('libzmq', '+zmq')
depends_on('[email protected]', when='+vfd')
depends_on('adios2', when='+adios')
depends_on('hermes_shm+mochi')
depends_on('hermes_shm+debug', when='+debug')
depends_on('hermes_shm+mpiio')
depends_on('hermes_shm+cereal')
depends_on('hermes_shm+boost')
depends_on('hermes_shm+ares', when='+ares')
depends_on('hermes_shm+zmq', when='+zmq')
depends_on('hermes_shm+vfd', when='+vfd')
depends_on('hermes_shm+adios', when='+adios')
depends_on('hermes_shm+encrypt', when='+encrypt')
depends_on('hermes_shm+compress', when='+compress')

def cmake_args(self):
args = []
Expand All @@ -72,6 +69,10 @@ def cmake_args(self):
args.append('-HERMES_ENABLE_STDIO_ADAPTER=ON')
if '+vfd' in self.spec:
args.append('-HERMES_ENABLE_VFD=ON')
if '+compress' in self.spec:
args.append(self.define('HERMES_ENABLE_COMPRESSION', 'ON'))
if '+encrypt' in self.spec:
args.append(self.define('HERMES_ENABLE_ENCRYPTION', 'ON'))
return args

def set_include(self, env, path):
Expand All @@ -92,6 +93,7 @@ def set_flags(self, env):
self.set_lib(env, '{}/lib'.format(self.prefix))
self.set_lib(env, '{}/lib64'.format(self.prefix))
env.prepend_path('CMAKE_PREFIX_PATH', '{}/cmake'.format(self.prefix))
env.prepend_path('CMAKE_MODULE_PATH', '{}/cmake'.format(self.prefix))

def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
self.set_flags(spack_env)
Expand Down
Loading

0 comments on commit 462b601

Please sign in to comment.