Packs full per-rank metadata down to active communication partners.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | counts_all(:) | |||
| integer, | intent(in) | :: | displs_all(:) | |||
| integer, | intent(out) | :: | nactive | |||
| integer, | intent(out), | allocatable | :: | ranks(:) | ||
| integer, | intent(out), | allocatable | :: | counts(:) | ||
| integer, | intent(out), | allocatable | :: | displs(:) |
subroutine pack_rank_metadata(counts_all, displs_all, nactive, ranks, counts, displs) integer, intent(in) :: counts_all(:), displs_all(:) integer, intent(out) :: nactive integer, allocatable, intent(out) :: ranks(:), counts(:), displs(:) integer :: r, i nactive = count(counts_all > 0) allocate(ranks(nactive)) allocate(counts(nactive)) allocate(displs(nactive)) i = 0 do r = 1, size(counts_all) if (counts_all(r) <= 0) cycle i = i + 1 ranks(i) = r - 1 counts(i) = counts_all(r) displs(i) = displs_all(r) end do end subroutine pack_rank_metadata