#1032349 libopenmpi-dev: MPI_Win_create fails with MPI_ERR_WIN for v4.1.0 and ob1

Package:
libopenmpi-dev
Source:
libopenmpi-dev
Description:
high performance message passing library -- header files
Submitter:
Pavel Stishenko
Date:
2023-03-04 13:30:04 UTC
Severity:
normal
Tags:
#1032349#5
Date:
2023-03-04 13:27:51 UTC
From:
To:
Dear Maintainer,


I have initially reported the issue at OpenMPI GiHub here:
https://github.com/open-mpi/ompi/issues/11466
But I can't reproduce it for the recent version 4.1.5 that I built from
source.
Also I can't reproduce it for the currently reported version 4.1.0 for
Fedora
So I believe that the issue is somehow related to Debian peculiarities.

The essence of the issue:

The following code:
```
#include <mpi.h>

int main(int argc, char *argv[]) {
  void   *buf;
  MPI_Win window;

  MPI_Init(&argc, &argv);
  MPI_Alloc_mem(16, MPI_INFO_NULL, &buf);
  MPI_Win_create(buf, 16, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &window);
  MPI_Win_free(&window);
  MPI_Free_mem(buf);
  MPI_Finalize();
}
```
compiled as

```
gcc testwin2.c  `pkg-config --cflags --libs ompi-c`   -o testwin.x
```

and being launched as

```
mpiexec.openmpi -n 2 --mca osc_base_verbose 100 --mca pml_base_verbose 100
 --mca btl_base_verbose 100  ./testwin.x
```

fails with error messages:
```
[localhost:43128] *** An error occurred in MPI_Win_create
[localhost:43128] *** reported by process [2029780993,1]
[localhost:43128] *** on communicator MPI_COMM_WORLD
[localhost:43128] *** MPI_ERR_WIN: invalid window
[localhost:43128] *** MPI_ERRORS_ARE_FATAL (processes in this communicator
will now abort,
[localhost:43128] ***    and potentially your MPI job)
```

The same code works well on Fedora PC both with ucx and ob1 PML
implementations with the same OpenMPI version 4.1.0