work_reducer Derived Type

type, public, abstract :: work_reducer

Communication backend of a partitioned calculation.

Intermediates that every part consumes in full, like the coordination number, can only be partitioned if the parts can exchange them halfway through the calculation. Providing a reducer enables those stages, omitting it leaves them to be evaluated redundantly by every part.


Type-Bound Procedures

procedure(reduce_interface), public, deferred :: reduce

  • subroutine reduce_interface(self, val, error) Prototype

    Sum a partitioned quantity over all parts, in place

    Arguments

    Type IntentOptional Attributes Name
    class(work_reducer), intent(in) :: self

    Communication backend

    real(kind=wp), intent(inout), contiguous :: val(:)

    Values to sum over all parts

    type(error_type), intent(out), allocatable :: error

    Error handling

Source Code

   type, abstract :: work_reducer
   contains
      procedure(reduce_interface), deferred :: reduce
   end type work_reducer