KaMPIng 0.2.1
(Near) zero-overhead MPI wrapper for C++
Loading...
Searching...
No Matches
kamping::types::ScopedDatatype Class Reference

RAII wrapper that commits an MPI_Datatype on construction and frees it on destruction. More...

#include <scoped_datatype.hpp>

Public Member Functions

 ScopedDatatype (MPI_Datatype type=MPI_DATATYPE_NULL)
 Construct a new scoped MPI_Datatype and commit it. If no type is provided, defaults to MPI_DATATYPE_NULL and does not commit or free anything.
 
 ScopedDatatype (ScopedDatatype const &)=delete
 Deleted copy constructor.
 
ScopedDatatypeoperator= (ScopedDatatype const &)=delete
 Deleted copy assignment.
 
 ScopedDatatype (ScopedDatatype &&other) noexcept
 Move constructor.
 
ScopedDatatypeoperator= (ScopedDatatype &&other) noexcept
 Move assignment.
 
MPI_Datatype constdata_type () const
 Get the MPI_Datatype.
 
 ~ScopedDatatype ()
 Free the MPI_Datatype.
 

Detailed Description

RAII wrapper that commits an MPI_Datatype on construction and frees it on destruction.

Calls MPI_Type_commit / MPI_Type_free directly and does not depend on the KaMPIng environment. Useful for managing custom derived datatypes with automatic lifetime.


The documentation for this class was generated from the following file: