fill the positions that describe how the data in the state vector relates to the entries in the buffer use memory that is allocated by mpi for the buffer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_longbuffer_type), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | pos(nvals) | |||
integer, | intent(in) | :: | nvals |
subroutine tem_commbuf_long_fillmpimem( me, pos, nvals ) ! -------------------------------------------------------------------- ! type(tem_longbuffer_type), intent(inout) :: me integer, intent(in) :: nvals integer, intent(in) :: pos(nvals) ! -------------------------------------------------------------------- ! integer(kind=long_k) :: typesample integer(kind=mpi_address_kind) :: typelen ! -------------------------------------------------------------------- ! typelen = int(c_sizeof(typesample), kind=mpi_address_kind) me%nvals = nvals if ( allocated(me%pos) ) deallocate(me%pos) allocate(me%pos(nvals)) me%pos = pos if ( associated(me%val) ) then nullify(me%val) call free_mpif_mem(me%mem_mpi) end if call alloc_mpif_mem( asize = nvals*typelen, & & baseptr = me%mem_mpi ) call c_f_pointer(me%mem_mpi, me%val, [me%nvals]) end subroutine tem_commbuf_long_fillmpimem