.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,3 +1 @@
|
||||
one-sided
|
||||
main
|
||||
persistent
|
||||
build
|
||||
|
@@ -106,6 +106,13 @@ if (MPI_FOUND)
|
||||
set_cxx_standard(one-sided)
|
||||
endif()
|
||||
|
||||
if (MPI_FOUND)
|
||||
add_executable(persistent persistent.cpp)
|
||||
target_link_libraries(persistent MPI::MPI_CXX)
|
||||
set_cxx_options(persistent)
|
||||
set_cxx_standard(persistent)
|
||||
endif()
|
||||
|
||||
if (MPI_FOUND AND CMAKE_CUDA_COMPILER)
|
||||
add_executable(one-sided-gpu one_sided_gpu.cpp)
|
||||
target_link_libraries(one-sided-gpu MPI::MPI_CXX)
|
||||
|
@@ -1,13 +1,11 @@
|
||||
# mpi_test
|
||||
|
||||
Various standalone MPI binaries, either tests or examples depending on your perspective.
|
||||
The goal is to compile with no warnings with `-Wall -Wextra -Wshadow -pedantic` or similarly picky settings.
|
||||
|
||||
Adjust `Makefile` to match your environment, if needed
|
||||
* uses `mpicxx` and a few simple flags by default
|
||||
|
||||
## Build
|
||||
```
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
|
@@ -27,14 +27,6 @@ int main(int argc, char **argv) {
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &size);
|
||||
|
||||
// expect our a to be set by the left
|
||||
int source;
|
||||
if (0 == rank) {
|
||||
source = size - 1;
|
||||
} else {
|
||||
source = rank - 1;
|
||||
}
|
||||
|
||||
int target; // set the right
|
||||
if (rank == size - 1) {
|
||||
target = 0;
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#include <mpi.h>
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <mpi.h>
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
Reference in New Issue
Block a user