You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to access a memory window on rank 0 created win MPI_Win_create with MPI_Win_shared_query on rank 1.
It does not work as expected (see code appended).
Instead of getting a base pointer of rank 0 (via MPI_Win_shared_query(win, 0, &ssize, &disp_unit, &baseptr); ), I get the base pointer of my own window on rank 1 together with the appropriate size if my window.
The absence of a shared memory windows seems to be standard conform, however unexpected.
But the size should be 0, not the size of my local window, correct?
2 questions arise:
Is the current implementation MPI conform?
Will MPI_Win_create be able to create shared memory windows accessible with MPI_Win_shared_query?
Maybe I did something wrong installation wise or code wise, I am thankful for any comment!
The code that returns MPI_Win_shared_query in mpidig_win.h
/* When only single process exists on the node or shared memory allocation fails,
* should only query MPI_PROC_NULL or local process. Thus, return local window's info. */
if (win->comm_ptr->node_comm == NULL || !shared_table) {
*size = win->size;
*disp_unit = win->disp_unit;
*((void **) baseptr) = win->base;
goto fn_exit;
}
The change log for mpich-v4.2.0rc3 states:
# MPI_Win_shared_query can be used on windows created by MPI_Win_create,
MPI_Win_allocate, in addition to windows created by MPI_Win_allocate_shared.
MPI_Win_allocate will create shared memory whenever feasible, including between
spawned processes on the same node.
The MPIv4.1 standard states:
MPI_Win_shared_query( )
...
Only MPI_WIN_ALLOCATE_SHARED is guaranteed to allocate shared memory. Im-
plementations are permitted, where possible, to provide shared memory for windows cre-
ated with MPI_WIN_CREATE and MPI_WIN_ALLOCATE. However, availability of shared
memory is not guaranteed. When the remote memory segment corresponding to a par-
ticular process cannot be accessed directly, this call returns size = 0 and a baseptr as if
MPI_ALLOC_MEM was called with size = 0.
...
_Advice to users._ For windows allocated using MPI_WIN_ALLOCATE or
MPI_WIN_CREATE, the group of MPI processes for which the implementation may
provide shared memory can be determined using MPI_COMM_SPLIT_TYPE described
in Section 7.4.2. (End of advice to users.)
I would like to linger on the question if MPI_Win_create will be able to create shared memory windows accessible with MPI_Win_shared_query? It currently does not look like it will be supported soon(?).
Would it be possible to highlight the fact that MPI_Win_create does not make memory available to MPI_Win_shared_query, and that these function call will always return size = 0, except when query the own window?
This could be done by adding a small sentence to the change log. This explicit mentioning of the fact would be very helpful!
You are correct that in the current release MPI_Win_create does not make the memory accessible to other processes even when they are in the same shared domain. But it seems plausible with kernel modules such as CMA and XPMEM, we could expose the memory to each other. So stay tuned.
hzhou
changed the title
Conformity + Clarification: MPI_Win_create + MPI_Win_shared_query does not work
shm: MPI_Win_create + MPI_Win_shared_query does not work
Feb 9, 2024
Version:
mpich v4.2.0rc3
I want to access a memory window on rank 0 created win
MPI_Win_create
withMPI_Win_shared_query
on rank 1.It does not work as expected (see code appended).
Instead of getting a base pointer of rank 0 (via
MPI_Win_shared_query(win, 0, &ssize, &disp_unit, &baseptr);
), I get the base pointer of my own window on rank 1 together with the appropriate size if my window.The absence of a shared memory windows seems to be standard conform, however unexpected.
But the size should be
0
, not the size of my local window, correct?2 questions arise:
MPI_Win_create
be able to create shared memory windows accessible withMPI_Win_shared_query
?Maybe I did something wrong installation wise or code wise, I am thankful for any comment!
The code that returns
MPI_Win_shared_query
inmpidig_win.h
The change log for
mpich-v4.2.0rc3
states:The MPIv4.1 standard states:
Example Code
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include <assert.h>
#define SIZE 10
int main(int argc, char *argv[]) {
}
The text was updated successfully, but these errors were encountered: