Skip to content

MCA settings required to run a windowing query #7532

@mathstuf

Description

@mathstuf

Background information

What version of Open MPI are you using? (e.g., v3.0.5, v4.0.2, git branch name and hash, etc.)

v4.0.2

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

Fedora 31

Please describe the system on which you are running

  • Operating system/version: Fedora 31
  • Computer hardware: Intel i7
  • Network type: Local?

Details of the problem

Probably related to #6275 (which is where I got the OMPI_MCA_osc=sm,pt2pt suggestion). I'm not completely sure what exactly is going wrong here (came across this in a test suite of a project I'm helping out with for CI). Reproducer with command line below:

#include <vector>
#include <cassert>
#include <mpi.h>

int main(int argc, char** argv)
{
    MPI_Init(&argc, &argv);

    int rank, size;
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_Comm_size(MPI_COMM_WORLD, &size);

    int width = 4;

    using T = int;
    std::vector<T> buffer_(width);
    MPI_Win window_;
    MPI_Win_create(buffer_.data(), buffer_.size()*sizeof(T), sizeof(T), MPI_INFO_NULL, MPI_COMM_WORLD, &window_);

    MPI_Win_lock_all(MPI_MODE_NOCHECK, window_);

    int target_rank = (rank + 2) % size;
    std::vector<int> out(width);
    for (int i = 0; i < width; ++i)
    {
        out[i] = target_rank * width + i;
        MPI_Put(&out[i], 1, MPI_INT, target_rank, i, 1, MPI_INT, window_);
    }
    MPI_Win_flush(target_rank, window_);

    MPI_Barrier(MPI_COMM_WORLD);

    int source_rank = (rank + 1) % size;
    std::vector<int> values(width);
    for (int i = 0; i < width; ++i)
    {
        MPI_Get(&values[i], 1, MPI_INT, source_rank, i, 1, MPI_INT, window_);
    }
    MPI_Win_flush_local(source_rank, window_);

    for (int i = 0; i < width; ++i)
    {
        assert(values[i] == source_rank*width + i);
    }

    MPI_Win_unlock_all(window_);

    MPI_Finalize();

    return 0;
}

Compile line (adapted and minimized from a CMake-generated command line):

/usr/bin/g++ -DOMPI_SKIP_MPICXX -isystem /usr/include/openmpi-x86_64 -pthread -o mpi-window-standalone -Wl,-rpath -Wl,/usr/lib64/openmpi/lib /usr/lib64/openmpi/lib/libmpi.so ../mpi-window-standalone.cpp

Either of these works:

% ./mpi-window-standalone
% OMPI_MCA_osc=sm,pt2pt /usr/lib64/openmpi/bin/mpiexec ./mpi-window-standalone

This fails:

% /usr/lib64/openmpi/bin/mpiexec ./mpi-window-standalone
[myhostname:1079189] Wrote -1, expected 4, errno = 14
[myhostname:1079189] Wrote -1, expected 4, errno = 14
[myhostname:1079189] Wrote -1, expected 4, errno = 14
[myhostname:1079189] Wrote -1, expected 4, errno = 14
[myhostname:1079189] Wrote -1, expected 4, errno = 14
<snip…and so on>

Cc: @mrzv

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions