Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 19 variants NotHostResident, NonCompact, UnsupportedDType { dtype: DType, }, TooManyElements { elements: u64, max: u64, }, RankTooLarge { rank: usize, max: usize, }, InvalidTag { tag: i32, }, SelfMessage, DTypeMismatch { expected: DType, received: DType, }, RankMismatch { expected: usize, received: usize, }, ShapeMismatch { expected: Vec<usize>, received: Vec<usize>, }, UnsupportedVersion { received: u16, supported: u16, }, MalformedHeader { reason: &'static str, }, UnexpectedFrame { kind: u8, }, ByteOrderMismatch { received: u8, }, PeerRejected { reason: RejectReason, }, PeerAborted { reason: AbortReason, }, PayloadCountMismatch { expected: i64, received: i64, }, InvalidBoolPayload, Tensor(Error),
}
Expand description

Failure of one transport call.

Variants split into three groups: local argument and payload checks (nothing is sent), receiver-side validation the sender is told about through the ack frame (Self::PeerRejected), and sender-side aborts the receiver is told about through an abort header (Self::PeerAborted).

§Examples

use tenferro_mpi::Error;

let error = Error::InvalidTag { tag: -1 };
assert_eq!(error.to_string(), "tag -1 is negative");

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotHostResident

The tensor’s storage is not host-addressed memory; nothing was sent.

The adapter never transfers between host and device: download the tensor explicitly (for a Dynamic owner, TypedTensor::into_host) first.

§

NonCompact

The payload is not one compact column-major host slice; nothing was sent.

§

UnsupportedDType

The dtype has no wire encoding; nothing was sent.

Fields

§dtype: DType

The dtype that could not be encoded.

§

TooManyElements

More elements than one MPI message can carry; nothing was sent.

Fields

§elements: u64

Declared element count.

§max: u64

Largest element count the wire protocol accepts.

§

RankTooLarge

The rank exceeds crate::MAX_WIRE_RANK; nothing was sent.

Fields

§rank: usize

Declared rank.

§max: usize

Largest rank the header can carry.

§

InvalidTag

The tag is negative; nothing was sent.

Fields

§tag: i32

The rejected tag.

§

SelfMessage

A blocking send to the calling rank would deadlock; nothing was sent.

§

DTypeMismatch

The receiver holds a different element type; the payload was not sent.

Fields

§expected: DType

The receiver’s element type.

§received: DType

The dtype the header declared.

§

RankMismatch

The receiver holds a different rank; the payload was not sent.

Fields

§expected: usize

The receiver’s rank.

§received: usize

The rank the header declared.

§

ShapeMismatch

The receiver holds a different shape; the payload was not sent.

Fields

§expected: Vec<usize>

The receiver’s shape.

§received: Vec<usize>

The shape the header declared.

§

UnsupportedVersion

The frame’s protocol version is not this crate’s.

Fields

§received: u16

Version found in the frame.

§supported: u16

Version this crate implements.

§

MalformedHeader

A frame could not be decoded.

Fields

§reason: &'static str

Which part of the frame failed.

§

UnexpectedFrame

A frame arrived where the protocol expects a different one.

Two ranks that send to each other on one tag at the same time each see the other’s header here, instead of hanging.

Fields

§kind: u8

The frame kind that arrived.

§

ByteOrderMismatch

The peer’s element byte order differs from the receiver’s.

Fields

§received: u8

The byte-order marker the header declared.

§

PeerRejected

The receiver refused the tensor; it sent this reason in the ack frame.

Fields

§reason: RejectReason

The receiver’s reason.

§

PeerAborted

The sender aborted before sending a payload.

Fields

§reason: AbortReason

The sender’s reason.

§

PayloadCountMismatch

The received payload length disagrees with the header.

Fields

§expected: i64

Byte count the header promised.

§received: i64

Byte count the frame actually carried.

§

InvalidBoolPayload

A bool payload carried a byte other than 0 or 1.

§

Tensor(Error)

A tenferro tensor accessor failed.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.