sync Subroutine

private subroutine sync(self, image)

Broadcasts network weights and biases from specified image to all others.

Arguments

Type IntentOptional AttributesName
class(network_type), intent(inout) :: self
integer(kind=ik), intent(in) :: image

Contents

Source Code


Source Code

  subroutine sync(self, image)
    !! Broadcasts network weights and biases from
    !! specified image to all others.
    class(network_type), intent(in out) :: self
    integer(ik), intent(in) :: image
    integer(ik) :: n
    if (num_images() == 1) return
    layers: do n = 1, size(self % dims)
#ifdef CAF
      call co_broadcast(self % layers(n) % b, image)
      call co_broadcast(self % layers(n) % w, image)
#endif
    end do layers
  end subroutine sync