1 /* Copyright (c) 2009-2020. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef SMPI_DATATYPE_DERIVED_HPP
8 #define SMPI_DATATYPE_DERIVED_HPP
10 #include "smpi_datatype.hpp"
15 class Type_Contiguous: public Datatype {
17 MPI_Datatype old_type_;
20 Type_Contiguous(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, MPI_Datatype old_type);
21 Type_Contiguous(const Type_Contiguous&) = delete;
22 Type_Contiguous& operator=(const Type_Contiguous&) = delete;
24 Type_Contiguous* clone() override;
25 void serialize(const void* noncontiguous, void* contiguous, int count) override;
26 void unserialize(const void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op) override;
29 class Type_Hvector: public Datatype{
33 MPI_Aint block_stride_;
34 MPI_Datatype old_type_;
37 Type_Hvector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int block_length, MPI_Aint block_stride,
38 MPI_Datatype old_type);
39 Type_Hvector(const Type_Hvector&) = delete;
40 Type_Hvector& operator=(const Type_Hvector&) = delete;
42 Type_Hvector* clone() override;
43 void serialize(const void* noncontiguous, void* contiguous, int count) override;
44 void unserialize(const void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op) override;
47 class Type_Vector : public Type_Hvector {
49 Type_Vector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int stride,
50 MPI_Datatype old_type);
51 Type_Vector* clone() override;
54 class Type_Hindexed: public Datatype{
58 MPI_Aint* block_indices_;
59 MPI_Datatype old_type_;
62 Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, const int* block_lengths,
63 const MPI_Aint* block_indices, MPI_Datatype old_type);
64 Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, const int* block_lengths, const int* block_indices,
65 MPI_Datatype old_type, MPI_Aint factor);
66 Type_Hindexed(const Type_Hindexed&) = delete;
67 Type_Hindexed& operator=(const Type_Hindexed&) = delete;
68 Type_Hindexed* clone() override;
70 void serialize(const void* noncontiguous, void* contiguous, int count) override;
71 void unserialize(const void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op) override;
74 class Type_Indexed : public Type_Hindexed {
76 Type_Indexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, const int* block_lengths, const int* block_indices,
77 MPI_Datatype old_type);
78 Type_Indexed* clone() override;
81 class Type_Struct: public Datatype{
84 MPI_Aint* block_indices_;
85 MPI_Datatype* old_types_;
88 Type_Struct(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, const int* block_lengths,
89 const MPI_Aint* block_indices, const MPI_Datatype* old_types);
90 Type_Struct(const Type_Struct&) = delete;
91 Type_Struct& operator=(const Type_Struct&) = delete;
92 Type_Struct* clone() override;
94 void serialize(const void* noncontiguous, void* contiguous, int count) override;
95 void unserialize(const void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op) override;
99 } // namespace simgrid