libmuscle.port module¶
- class libmuscle.port.Port(name: str, operator: Operator, is_vector: bool, is_connected: bool, our_ndims: int, peer_dims: List[int])[source]¶
Bases:
Port
Represents a gateway to the outside world.
Ports can be used to send or receive messages. They have a name and an operator, as well as a set of dimensions that determines the valid slot indices for sending or receiving on this port.
- name¶
Name of this port.
- Type
Identifier
- operator¶
Operator associated with this port.
- Type
Operator
Create a Port.
- Parameters
name – Name of this port.
operator – Corresponding operator.
is_vector – Whether this is a vector port.
is_connected – Whether this port is connected to a peer.
our_ndims – Number of dimensions of our instance set.
peer_dims – Dimensions of the peer instance set of this port.
- get_length() int [source]¶
Returns the length of this port.
- Raises
RuntimeError – If this port is a scalar port.
- is_connected() bool [source]¶
Returns whether the port is connected to a peer.
- Returns
True if there is a peer, False if there is not.