diff --git a/.gitignore b/.gitignore index 526ac83..378eac2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -one-sided -main -persistent +build diff --git a/CMakeLists.txt b/CMakeLists.txt index f5239c1..eb8eca8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/README.md b/README.md index fa3a85c..7919634 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/one_sided_gpu.cpp b/one_sided_gpu.cpp index 2c08dd5..9754c80 100644 --- a/one_sided_gpu.cpp +++ b/one_sided_gpu.cpp @@ -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; diff --git a/persistent.cpp b/persistent.cpp index 6f149d6..c1b395a 100644 --- a/persistent.cpp +++ b/persistent.cpp @@ -1,7 +1,8 @@ -#include #include #include +#include +#include #include #include