This commit is contained in:
Carl William Pearson
2021-06-02 11:01:04 -06:00
parent b60fb01330
commit fde859b825
5 changed files with 12 additions and 16 deletions

4
.gitignore vendored
View File

@@ -1,3 +1 @@
one-sided build
main
persistent

View File

@@ -106,6 +106,13 @@ if (MPI_FOUND)
set_cxx_standard(one-sided) set_cxx_standard(one-sided)
endif() 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) if (MPI_FOUND AND CMAKE_CUDA_COMPILER)
add_executable(one-sided-gpu one_sided_gpu.cpp) add_executable(one-sided-gpu one_sided_gpu.cpp)
target_link_libraries(one-sided-gpu MPI::MPI_CXX) target_link_libraries(one-sided-gpu MPI::MPI_CXX)

View File

@@ -1,13 +1,11 @@
# mpi_test # mpi_test
Various standalone MPI binaries, either tests or examples depending on your perspective. 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 ## Build
``` ```
mkdir build && cd build
cmake ..
make make
``` ```

View File

@@ -27,14 +27,6 @@ int main(int argc, char **argv) {
MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size); 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 int target; // set the right
if (rank == size - 1) { if (rank == size - 1) {
target = 0; target = 0;

View File

@@ -1,7 +1,8 @@
#include <mpi.h>
#include <cstdio> #include <cstdio>
#include <vector> #include <vector>
#include <cstdlib>
#include <mpi.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <errno.h> #include <errno.h>