-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,545 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,138 @@ | ||
# GaspiCxx | ||
|
||
GaspiCxx is a C++ interface for the communication library GPI-2. The C++ interface aims at an abstraction for the native C based communication interface of GPI-2 without impacting the underlying performance. The interface design makes the explicit management of communication resources required by the native | ||
C interface fully transparent to the application. They do not need to be managed explicitly any more. Instead, objects with exclusive and auto-managed resources for groups, queues, segments are provided by GaspiCxx. The dynamic management of segment memory and segment synchronization primitives is provided by allocators. The single-sided and the passive communication are built on top of that. Allocations within the partitioned global address space and the respective synchronization primitives can be easily connected with each other on the source and the target side for efficient communication. | ||
GaspiCxx is a C++ interface for the GPI-2 communication library, | ||
which aims at providing a high-level abstraction layer on top of | ||
the native communication primitives. | ||
GaspiCxx is designed to achieve the following goals: | ||
* scalability | ||
* performance | ||
* productivity | ||
|
||
The interface design replaces the explicit management of communication | ||
resources required by the native GPI-2 interface with fully-transparent | ||
and easy-to-use primitives. | ||
The GaspiCxx API implements the following automatically managed resources: | ||
* Groups | ||
* Segments | ||
* Queues | ||
* Point-to-point single-sided communication primitives | ||
* SourceBuffer/TargetBuffers | ||
* Non-blocking collective primitives | ||
* Allreduce | ||
* Allgatherv | ||
* Broadcast | ||
* Blocking collectives | ||
* Barrier | ||
|
||
Additionally, GaspiCxx provides a Python extension called `PyGPI`, which exposes the | ||
GaspiCxx point-to-point and collective primitives as an easy-to-use, intuitive Python library. | ||
More details regarding the installation and configuration of `PyGPI` can be found | ||
[here](src/python/README.md). | ||
|
||
|
||
## Installation | ||
|
||
### Compiler and build system | ||
|
||
GaspiCxx can be built using a recent compiler with support for C++17. | ||
It was tested with [gcc](https://gcc.gnu.org/) starting from version `8.4.0` and [clang](https://clang.llvm.org/) `10.0.0`. | ||
You will also need the build tool [CMake](https://cmake.org/) (from version `3.12`). | ||
|
||
|
||
### Step 1: Software dependencies | ||
|
||
GaspiCxx depends on | ||
GaspiCxx depends on: | ||
|
||
- Google test | ||
- [GPI-2](https://github.com/cc-hpc-itwm/GPI-2) | ||
- (Optional) Google test | ||
|
||
#### Installing GPI-2 | ||
|
||
To install `GPI-2`, clone the following [git repository](https://github.com/cc-hpc-itwm/GPI-2.git) | ||
and checkout the `1.5.1` tag: | ||
|
||
```bash | ||
git clone https://github.com/cc-hpc-itwm/GPI-2.git | ||
cd GPI-2 | ||
git fetch --tags | ||
git checkout -b v1.5.1 v1.5.1 | ||
``` | ||
|
||
Now, use [autotools](https://www.gnu.org/software/automake/) | ||
to configure and compile the code: | ||
|
||
```bash | ||
./autogen.sh | ||
export GPI2_INSTALLATION_PATH=/your/installation/path | ||
CFLAGS="-fPIC" CPPFLAGS="-fPIC" ./configure --with-infiniband --prefix=${GPI2_INSTALLATION_PATH} | ||
make $nprocs | ||
``` | ||
|
||
where `${GPI2_INSTALLATION_PATH}` needs to be replaced with the path where you want to install | ||
GPI-2. Note the `--with-infiniband` option, which should be used on most HPC clusters that | ||
provide Infiniband support. | ||
|
||
In case you want to install GPI-2 on a laptop or workstation, replace the above | ||
option with ``--with-ethernet``, which will use standard TCP sockets for communication. | ||
Now you are ready to install GPI-2 with: | ||
|
||
```bash | ||
make install | ||
export PATH=${GPI2_INSTALLATION_PATH}/bin:$PATH | ||
``` | ||
|
||
### Step 2: Build GaspiCxx | ||
|
||
CMake is used as build system The dependency to GPI-2 is resolved by pkg-config. In order to allow CMake to find the GPI-2 configuration files, the path `GPI2_INSTALL_DIR/lib64/pkgconfig` needs to be appended to the `PKG_CONFIG_PATH` environment variable before invocation of CMake, e.g. by | ||
Compile and install the GaspiCxx library as follows: | ||
|
||
```bash | ||
git clone https://github.com/cc-hpc-itwm/GaspiCxx.git | ||
cd GaspiCxx | ||
mkdir build && cd build | ||
|
||
export GASPICXX_INSTALLATION_PATH=/your/gaspicxx/installation/path | ||
cmake -DCMAKE_INSTALL_PREFIX=${GASPICXX_INSTALLATION_PATH} ../ | ||
make -j$nprocs install | ||
``` | ||
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:GPI2_INSTALL_DIR/lib64/pkgconfig | ||
|
||
### (Optional) Step 3: Run tests | ||
|
||
#### Install Google Test | ||
|
||
Download and install Google test from its | ||
[GitHub repository](https://github.com/google/googletest/tree/main/googletest). | ||
|
||
```bash | ||
export GTEST_INSTALLATION_PATH=/path/to/gtest | ||
|
||
git clone https://github.com/google/googletest.git -b release-1.11.0 | ||
cd googletest | ||
mkdir build && cd build | ||
cmake -DCMAKE_INSTALL_PREFIX=${GTEST_INSTALLATION_PATH} ../ | ||
make -j$nprocs install | ||
``` | ||
|
||
#### Compile GaspiCxx with testing enabled | ||
|
||
```bash | ||
export GASPICXX_INSTALLATION_PATH=/your/gaspicxx/installation/path | ||
cmake -DENABLE_TESTS=ON \ | ||
-DCMAKE_PREFIX_PATH=${GTEST_INSTALLATION_PATH} \ | ||
-DCMAKE_INSTALL_PREFIX=${GASPICXX_INSTALLATION_PATH} ../ | ||
make -j$nprocs install | ||
``` | ||
|
||
#### Run tests | ||
GaspiCxx tests can be executed using the `ctest` command | ||
```bash | ||
# list tests | ||
ctest -N | ||
|
||
# run all tests | ||
ctest | ||
``` | ||
|
||
|
||
## License | ||
This project is licensed under the GPLv3.0 License - see the | ||
[COPYING](COPYING) file for details |
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,60 @@ | ||
#[=======================================================================[.rst: | ||
FindPythonModules | ||
------- | ||
Finds installed PythonModules | ||
Result Variables | ||
^^^^^^^^^^^^^^^^ | ||
This will define the following variables: | ||
``PythonModules_FOUND`` | ||
True if all the required PythonModules could be loaded. | ||
``PythonModules_modulename_FOUND`` | ||
True if `modulename` could be loaded. | ||
``Python_EXECUTABLE`` | ||
Path to the Python executable. | ||
Cache Variables | ||
^^^^^^^^^^^^^^^ | ||
The following cache variables may also be set: | ||
``GPI2_INCLUDE_DIR`` | ||
The directory containing ``gaspi.h``. | ||
``GPI2_LIBRARY`` | ||
The path to the GPI2 library. | ||
#]=======================================================================] | ||
|
||
execute_process(COMMAND sh -c "which python" | ||
OUTPUT_VARIABLE python_path | ||
RESULT_VARIABLE result | ||
ERROR_QUIET | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
if (result EQUAL "0" AND EXISTS ${python_path}) | ||
set(Python_EXECUTABLE "${python_path}") | ||
endif() | ||
|
||
set(PythonModules_FOUND TRUE) | ||
if (Python_EXECUTABLE) | ||
foreach (module IN LISTS PythonModules_FIND_COMPONENTS) | ||
execute_process(COMMAND ${Python_EXECUTABLE} -c | ||
"import ${module}" | ||
RESULT_VARIABLE result | ||
ERROR_QUIET OUTPUT_QUIET) | ||
|
||
if(result) | ||
set (PythonModules_${module}_FOUND FALSE) | ||
set (PythonModules_FOUND FALSE) | ||
else() | ||
set (PythonModules_${module}_FOUND TRUE) | ||
endif() | ||
endforeach() | ||
endif() | ||
|
||
include (FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args (PythonModules | ||
REQUIRED_VARS Python_EXECUTABLE PythonModules_FOUND | ||
HANDLE_COMPONENTS) |
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,17 @@ | ||
include (parse_arguments) | ||
|
||
function (configure_version) | ||
set(one_value_options VERSION_FILE) | ||
set(required_options VERSION_FILE) | ||
_parse_arguments(ARG "${options}" "${one_value_options}" | ||
"${multi_value_options}" "${required_options}" ${ARGN}) | ||
|
||
file(READ ${ARG_VERSION_FILE} ver) | ||
string(REGEX MATCH "gaspicxx_version[ ]*=[ ]*[\'\"]([0-9]+\.[0-9]+\.[0-9]+)[\'\"]" _ ${ver}) | ||
if(CMAKE_MATCH_COUNT EQUAL 1) | ||
set(TNT_VERSION ${CMAKE_MATCH_1} PARENT_SCOPE) | ||
message(STATUS "GaspiCxx version: ${CMAKE_MATCH_1}") | ||
else() | ||
message(FATAL_ERROR "Invalid version string in ${ARG_VERSION_FILE}" ) | ||
endif() | ||
endfunction() |
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
Oops, something went wrong.