Wrapper for shared_allocate_mpi that tests if the pointer is associated
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(shared_array_bool_t), | intent(inout) | :: | this | |||
| integer(kind=int64), | intent(in) | :: | size |
size of the memory segment to be allocated |
||
| character(len=*), | intent(in), | optional | :: | name |
subroutine safe_shared_memory_alloc_bool (this, size, name) class(shared_array_bool_t), intent(inout) :: this integer(int64), intent(in) :: size character(*), intent(in), optional :: name character(*), parameter :: t_r = "shared_alloc" ! if pointer was allocated prior, re-allocate the probabilities ! WARNING: DO NOT MANUALLY RE-ASSIGN ptr, THIS WILL MOST LIKELY BREAK STUFF call safe_shared_memory_dealloc_bool (this) call shared_allocate_mpi(this%win, this%ptr, (/size/)) ! If a name is given, log the allocation if (associated(this%ptr) .and. present(name)) & call LogMemAlloc(name, size, sizeof(this%ptr(1)), t_r, this%tag) end subroutine safe_shared_memory_alloc_bool