1 /* Copyright (c) 2009-2018. 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);
22 void serialize(void* noncontiguous, void* contiguous, int count);
23 void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
26 class Type_Hvector: public Datatype{
29 MPI_Aint block_stride_;
30 MPI_Datatype old_type_;
33 Type_Hvector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int block_length, MPI_Aint block_stride,
34 MPI_Datatype old_type);
36 void serialize(void* noncontiguous, void* contiguous, int count);
37 void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
40 class Type_Vector : public Type_Hvector {
42 Type_Vector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int stride,
43 MPI_Datatype old_type);
46 class Type_Hindexed: public Datatype{
49 MPI_Aint* block_indices_;
50 MPI_Datatype old_type_;
53 Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths,
54 MPI_Aint* block_indices, MPI_Datatype old_type);
55 Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, int* block_indices,
56 MPI_Datatype old_type, MPI_Aint factor);
58 void serialize(void* noncontiguous, void* contiguous, int count);
59 void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
62 class Type_Indexed : public Type_Hindexed {
64 Type_Indexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, int* block_indices,
65 MPI_Datatype old_type);
68 class Type_Struct: public Datatype{
71 MPI_Aint* block_indices_;
72 MPI_Datatype* old_types_;
75 Type_Struct(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths,
76 MPI_Aint* block_indices, MPI_Datatype* old_types);
78 void serialize(void* noncontiguous, void* contiguous, int count);
79 void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);