This behavior is clearly specified in the standard. From MPI 3.1 § 11.2.4:

In the case of a window created with MPI_WIN_CREATE_DYNAMIC, the target_disp for all RMA functions is the address at the target; i.e., the effective window_base is MPI_BOTTOM and the disp_unit is one. For dynamic windows, the target_disp argument to RMA communication operations is not restricted to non-negative values. Users should use MPI_GET_ADDRESS at the target process to determine the address of a target memory location and communicate this address to the origin process.


So by using a target address of 0 you are effectively trying to write to NULL. osc/pt2pt's bounds checking isn't perfect so it is giving a SEGV.

-Nathan

On May 04, 2017, at 03:18 PM, "Clune, Thomas L. (GSFC-6101)" <thomas.l.cl...@nasa.gov> wrote:

I have encountered a problem that seems well suited to dynamic windows with one-sided comunication. To verify my understanding, I put together a simple demo code (attached). My initial attempt consistently crashed until I stumbled upon passing the base address of the attached memory on the _target_ process to the sending process in advance of the MPI_Put() call. Previously, I’d been specifying a displacement of 0 in the put.

The part I find confusing is that essentially the same example using MPI_Win_allocate() did _not_ require passing the displacement. I.e., MPI_Put() used a displacement of zero and my data ended up where I expected it on the target process. This would suggest that MPI_Put() must be used differently depending on whether or not a window is dynamic. I did not find this mentioned anywhere in the documentation, nor did I find any example code that demonstrated this extra communication for the displacement.

OTOH, this does help to explain another question I had about dynamic windows. The documentation states that there can me multiple (nonoverlapping) memory regions attached to a window, but does not mention how to target specific regions.

If I’m right about all of this, then I guess this is just a request for the relevant parties to improve the documentation and the various examples found on the web. If I’m wrong, then I’d appreciate enlightenment.

I apologize in advance that the attached code is in Fortran (my native tongue). The code runs fine as-is. But if the commented out MPI_Put() call is substituted for the uncommented one, it will crash with a segmentation fault.



_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users

Attachment: mpi_win_dynamic.F90
Description: Binary data

_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users

Reply via email to