This module handles share memory using MPI3 and records the allocation in a linked list such that shared memory can be accessed later in arbitrary location of the code (hopefully)
To do: 1) node barrier with mpi_win_fence (?) 2) extend the redistribution to David's non-blocking mpi
Questions: Can the reference from application array to shm array done safe in fortran (allowing for copy in). Does target attribute helps? What happens if the size on a node is 0? Is base_ptr set to c_nul_ptr? More on the above questions
A clearer way to identify the segments is to return a tag whem shm_alloc is called and to use that tag to get the asociated arrays inside the node. the oply drawback of this is that the application must keep a record of the tags, but this seems similar to other 1-ish kind of tags.
Lucian Anton May 2014
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | private | :: | initialized_shm | = | .false. | ||
integer, | private, | parameter | :: | maxlen | = | 127 | |
type(shm_node_pointers_t), | private, | pointer | :: | shm_pointers | => | null() | |
type(shm_node_pointers_t), | private, | pointer | :: | shm_ptr_head | => | null() | |
type(shm_info_t), | public, | save | :: | shm_info | |||
integer, | private, | save | :: | counter | = | 0 | |
integer, | private, | save | :: | info_noncontig | = | MPI_INFO_NULL | |
logical, | private, | parameter | :: | debug | = | .false. |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | pointer | :: | a(:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | pointer | :: | a(:,:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | pointer | :: | a(:,:,:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | pointer | :: | a(:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | pointer | :: | a(:,:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | pointer | :: | a(:,:,:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout) | :: | a(:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout) | :: | a(:,:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout) | :: | a(:,:,:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout) | :: | a(:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout) | :: | a(:,:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout) | :: | a(:,:,:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | pin(:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | pin(:,:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | pin(:,:,:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | pin(:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | pin(:,:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | pin(:,:,:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
complex, | intent(in), | DIMENSION(lb1:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
integer, | intent(in) | :: | lb2 | |||
complex, | intent(in), | DIMENSION(lb1:, lb2:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
integer, | intent(in) | :: | lb2 | |||
integer, | intent(in) | :: | lb3 | |||
complex, | intent(in), | DIMENSION(lb1:,lb2:,lb3:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
real, | intent(in), | DIMENSION(lb1:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
integer, | intent(in) | :: | lb2 | |||
real, | intent(in), | DIMENSION(lb1:, lb2:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
integer, | intent(in) | :: | lb2 | |||
integer, | intent(in) | :: | lb3 | |||
real, | intent(in), | DIMENSION(lb1:,lb2:,lb3:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | a |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | a |
FIXME : Add documentation
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | comm | ||||
integer, | public | :: | wcomm | ||||
integer, | public | :: | size | ||||
integer, | public | :: | id | ||||
integer, | public, | allocatable | :: | wranks(:) |
FIXME : Add documentation
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | id | ||||
integer, | public | :: | win | ||||
integer, | public | :: | ndim | ||||
type(c_ptr), | public, | allocatable | :: | nd(:) | |||
type(shm_node_pointers_t), | public, | pointer | :: | next | => | null() | |
integer, | public | :: | tag | ||||
integer, | public, | allocatable | :: | se(:,:) | |||
character(len=maxlen), | public | :: | label |
Checks if a node rank belong to the curent node
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ip |
returns node id corresponding to ip -1 in case of error
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ip |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | pin(:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | pin(:,:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | pin(:,:,:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | pin(:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | pin(:,:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | pin(:,:,:) | ||
integer, | intent(in) | :: | id | |||
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
complex, | intent(in), | DIMENSION(lb1:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
integer, | intent(in) | :: | lb2 | |||
complex, | intent(in), | DIMENSION(lb1:, lb2:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
integer, | intent(in) | :: | lb2 | |||
integer, | intent(in) | :: | lb3 | |||
complex, | intent(in), | DIMENSION(lb1:,lb2:,lb3:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
real, | intent(in), | DIMENSION(lb1:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
integer, | intent(in) | :: | lb2 | |||
real, | intent(in), | DIMENSION(lb1:, lb2:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | lb1 | |||
integer, | intent(in) | :: | lb2 | |||
integer, | intent(in) | :: | lb3 | |||
real, | intent(in), | DIMENSION(lb1:,lb2:,lb3:), TARGET | :: | array |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | wcomm | |||
logical, | intent(in), | optional | :: | split_ |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | pointer | :: | a(:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | pointer | :: | a(:,:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | pointer | :: | a(:,:,:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ndim | |||
integer, | intent(in) | :: | lubd(2*ndim) | |||
complex, | intent(inout), | optional, | pointer | :: | a1(:) | |
complex, | intent(inout), | optional, | pointer | :: | a2(:,:) | |
complex, | intent(inout), | optional, | pointer | :: | a3(:,:,:) | |
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | pointer | :: | a(:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | pointer | :: | a(:,:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | pointer | :: | a(:,:,:) | ||
integer, | intent(in) | :: | lubd(:) | |||
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ndim | |||
integer, | intent(in) | :: | lubd(2*ndim) | |||
real, | intent(inout), | optional, | pointer | :: | a1(:) | |
real, | intent(inout), | optional, | pointer | :: | a2(:,:) | |
real, | intent(inout), | optional, | pointer | :: | a3(:,:,:) | |
integer, | intent(out), | optional | :: | tag | ||
character(len=maxlen), | intent(in), | optional | :: | label | ||
integer, | intent(out), | optional | :: | ierror |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout) | :: | a(:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout) | :: | a(:,:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout) | :: | a(:,:,:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | target | :: | a(*) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout) | :: | a(:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout) | :: | a(:,:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout) | :: | a(:,:,:) |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | target | :: | a(*) |
FIXME : Add documentation
ifdef 1
endif
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | a |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | a |
FIXME : Add documentation
$ pointer_array: do j = 1, size(shm_info%g_lo_ptr)
$ do i = 0, shm_info%size -1
$ s = shm_info%g_lo_se(1, i)
$ e = shm_info%g_lo_se(2, i)
$ aux => shm_info%g_lo_ptr(j)%p(:,:, s:e)
$ !print*,'get_node_pointer', iproc, i,j,s,e
$ if ( associated(aux, pin)) then
$ get_node_pointer => shm_info%g_lo_ptr(j)%p
$ !print'(a,7(i5,x))','get_node_pointer', iproc, lbound(get_node_pointer), ubound(get_node_pointer)
$ exit pointer_array
$ endif
$ end do
$ enddo pointer_array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | target | :: | pin(*) | ||
integer, | intent(in) | :: | id | |||
complex, | intent(out), | optional, | pointer | :: | a1(:) | |
complex, | intent(out), | optional, | pointer | :: | a2(:,:) | |
complex, | intent(out), | optional, | pointer | :: | a3(:,:,:) | |
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
$ pointer_array: do j = 1, size(shm_info%g_lo_ptr)
$ do i = 0, shm_info%size -1
$ s = shm_info%g_lo_se(1, i)
$ e = shm_info%g_lo_se(2, i)
$ aux => shm_info%g_lo_ptr(j)%p(:,:, s:e)
$ !print*,'get_node_pointer', iproc, i,j,s,e
$ if ( associated(aux, pin)) then
$ get_node_pointer => shm_info%g_lo_ptr(j)%p
$ !print'(a,7(i5,x))','get_node_pointer', iproc, lbound(get_node_pointer), ubound(get_node_pointer)
$ exit pointer_array
$ endif
$ end do
$ enddo pointer_array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | target | :: | pin(*) | ||
integer, | intent(in) | :: | id | |||
real, | intent(out), | optional, | pointer | :: | a1(:) | |
real, | intent(out), | optional, | pointer | :: | a2(:,:) | |
real, | intent(out), | optional, | pointer | :: | a3(:,:,:) | |
integer, | intent(in), | optional | :: | tag |
FIXME : Add documentation
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | s |