bempp_cl.api.utils.remote_operator ================================== .. py:module:: bempp_cl.api.utils.remote_operator .. autoapi-nested-parse:: Implementation of MPI based remote operators. Attributes ---------- .. autoapisummary:: bempp_cl.api.utils.remote_operator.MPI_SIZE bempp_cl.api.utils.remote_operator.MPI_RANK bempp_cl.api.utils.remote_operator.COMM bempp_cl.api.utils.remote_operator._REMOTE_MANAGER Classes ------- .. autoapisummary:: bempp_cl.api.utils.remote_operator.Message bempp_cl.api.utils.remote_operator.RemoteManager bempp_cl.api.utils.remote_operator.RemoteBlockedOperator bempp_cl.api.utils.remote_operator.RemoteBlockedDiscreteOperator Functions --------- .. autoapisummary:: bempp_cl.api.utils.remote_operator.get_remote_manager Module Contents --------------- .. py:data:: MPI_SIZE .. py:data:: MPI_RANK .. py:data:: COMM .. py:data:: _REMOTE_MANAGER :value: None .. py:class:: Message(status, operator_tag=None, is_complex=False, nelements=None) Messages for remote workers. .. py:attribute:: status .. py:attribute:: is_complex :value: False .. py:attribute:: operator_tag :value: None .. py:attribute:: nelements :value: None .. py:class:: RemoteManager Manage remote worker execution. .. py:attribute:: _op_data .. py:attribute:: _op_location .. py:attribute:: _tags .. py:attribute:: _tags_counter :value: 0 .. py:attribute:: _rank_counter :value: 1 .. py:method:: register(op) Register operator for remote execution. .. py:method:: execute_worker() Execute on workers. .. py:method:: send_data(msg, dest, operator_tag=None, data=None) Send data to destination rank. .. py:method:: send_error(msg, operator_tag) Send error message to master. .. py:method:: receive_data(source) Receive data. .. py:method:: submit_computation(op, x) Submit computation to operator. .. py:method:: receive_result(op) Receive result from a specific operator. .. py:method:: assemble(op) Assemble a given remote operator. .. py:method:: barrier() Use barrier operation for workers. .. py:method:: get_operator_dtype(tag) Get dtype of remote operator. .. py:method:: shutdown() Shutdown all workers. .. py:method:: _group_by_rank(tags) Group tags by for parallel computation. Given a list of tags (with possible repetitions). Return a list of list of positions in the tags list that is sorted so that each sublist does not have repeating ranks. This allows to distribute the computations effectively on the ranks. .. py:method:: assemble_parallel(ops) Assemble a list of operators in parallel. .. py:method:: compute_parallel(tasks) Compute in parallel. Parameters ---------- tasks : list A list [(op1, data1), (op2, data2), ...] of operators and associated vectors. Returns a list [result1, result2, ...] of the results of the computation. Operators are allowed to appear repeatedly in the list and are scheduled correctly. .. py:property:: tags Return tags. .. py:function:: get_remote_manager() Initialize remote manager. .. py:class:: RemoteBlockedOperator(m, n) Bases: :py:obj:`bempp_cl.api.assembly.blocked_operator.BlockedOperator` Define a remote blocked operator. .. py:method:: _assemble() Assemble the operator. .. py:class:: RemoteBlockedDiscreteOperator(ops) Bases: :py:obj:`bempp_cl.api.assembly.discrete_boundary_operator._DiscreteOperatorBase` Implementation of a discrete blocked boundary operator. .. py:attribute:: _manager :value: None .. py:attribute:: _ndims .. py:attribute:: _operators .. py:attribute:: _tags .. py:attribute:: _rows .. py:attribute:: _cols .. py:method:: __getitem__(key) Return the object at position (i, j). .. py:method:: _get_shape(op) Get shape of boundary operator. .. py:method:: _fill_complete() Check if the fill is complete. .. py:method:: _matvec(x) Perform matrix vector multiplication. .. py:method:: _get_row_dimensions() Return the number of rows. .. py:method:: _get_column_dimensions() Return the number of columns. .. py:property:: A :abstractmethod: Return as dense Numpy array. .. py:method:: _transpose() :abstractmethod: Implement the transpose. .. py:method:: _adjoint() :abstractmethod: Implement the adjoint. .. py:attribute:: row_dimensions .. py:attribute:: column_dimensions