1 /* Copyright (c) 2009-2010, 2012-2017. 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_Vector: public Datatype{
30 MPI_Datatype old_type_;
33 Type_Vector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int 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_Hvector: public Datatype{
43 MPI_Aint block_stride_;
44 MPI_Datatype old_type_;
47 Type_Hvector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int block_length, MPI_Aint block_stride,
48 MPI_Datatype old_type);
50 void serialize(void* noncontiguous, void* contiguous, int count);
51 void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
54 class Type_Indexed: public Datatype{
58 MPI_Datatype old_type_;
61 Type_Indexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, int* block_indices,
62 MPI_Datatype old_type);
64 void serialize(void* noncontiguous, void* contiguous, int count);
65 void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
68 class Type_Hindexed: public Datatype{
71 MPI_Aint* block_indices_;
72 MPI_Datatype old_type_;
75 Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths,
76 MPI_Aint* block_indices, MPI_Datatype old_type);
78 void serialize(void* noncontiguous, void* contiguous, int count);
79 void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
82 class Type_Struct: public Datatype{
85 MPI_Aint* block_indices_;
86 MPI_Datatype* old_types_;
89 Type_Struct(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths,
90 MPI_Aint* block_indices, MPI_Datatype* old_types);
92 void serialize(void* noncontiguous, void* contiguous, int count);
93 void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);