Class t8_abstract_vector_handler

Inheritance Relationships

Derived Type

Class Documentation

class t8_abstract_vector_handler

A base class for vector handlers.

Subclassed by t8_vector_handler< TType >

Public Functions

virtual int buffer_size(sc_MPI_Comm comm) = 0

Pure virtual function to determine the buffer size.

This function must be implemented by derived classes to calculate the size of the buffer required for communication.

Parameters:

comm[in] The MPI communicator.

Returns:

The size of the buffer.

virtual void pack_vector_prefix(void *buffer, const int num_bytes, int &pos, sc_MPI_Comm comm) = 0

Packs a vector into a buffer. The vector data will be prefixed with the number of elements in the vector.

This pure virtual function is responsible for packing a vector prefix into the provided buffer.

Parameters:
  • buffer[inout] A pointer to the buffer where the vector prefix will be packed.

  • num_bytes[in] The number of bytes to be packed.

  • pos[inout] A reference to an integer representing the current position in the buffer. This will be updated as bytes are packed.

  • comm[in] The MPI communicator used for the operation.

virtual void unpack_vector_prefix(const void *buffer, const int num_bytes, int &pos, int &outcount, sc_MPI_Comm comm) = 0

Unpacks a vector from a buffer. Expected to be prefixed with the number of elements in the vector.

This pure virtual function is responsible for unpacking a vector prefix from the provided buffer.

Parameters:
  • buffer[in] Pointer to the buffer containing the packed data.

  • num_bytes[in] The number of bytes in the buffer.

  • pos[in] Reference to an integer representing the current position in the buffer. This will be updated as data is unpacked.

  • outcount[in] Reference to an integer where the count of unpacked elements will be stored.

  • comm[in] The MPI communicator used for the operation.

virtual int send(const int dest, const int tag, sc_MPI_Comm comm) = 0

Pure virtual function to send data to a specified destination.

This function is responsible for packing and sending data to a given destination with a specific tag using the provided MPI communicator.

Parameters:
  • dest[in] The destination rank to which the data will be sent.

  • tag[in] The tag associated with the message to be sent.

  • comm[in] The MPI communicator used for the communication.

Returns:

An integer indicating the status of the send operation.

virtual int recv(const int source, const int tag, sc_MPI_Comm comm, sc_MPI_Status *status, int &outcount) = 0

Receives a message from a specified source.

This pure virtual function is responsible for receiving and unpacking a message from a given source with a specific tag within the provided MPI communicator. The function will also update the status and output count of the received message.

Parameters:
  • source[in] The rank of the source process from which the message is received.

  • tag[in] The tag of the message to be received.

  • comm[in] The MPI communicator within which the message is received.

  • status[in] A pointer to an MPI status object that will be updated with the status of the received message.

  • outcount[in] A reference to an integer that will be updated with the count of received elements.

Returns:

An integer indicating the success or failure of the receive operation.

virtual t8_data_handler_type type() = 0

Pure virtual function to get the type.

This function must be overridden in derived classes to return the type.

Returns:

An integer representing the type.

inline virtual ~t8_abstract_vector_handler()