Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / smpi / include / smpi_datatype_derived.hpp
1 /* Copyright (c) 2009-2010, 2012-2017. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #ifndef SMPI_DATATYPE_DERIVED_HPP
8 #define SMPI_DATATYPE_DERIVED_HPP
9
10 #include "smpi_datatype.hpp"
11
12 namespace simgrid{
13 namespace smpi{
14
15 class Type_Contiguous: public Datatype {
16   private:
17     int block_count_;
18     MPI_Datatype old_type_;
19   public:
20     Type_Contiguous(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, MPI_Datatype old_type);
21     ~Type_Contiguous();
22     void serialize( void* noncontiguous, void *contiguous,
23                             int count);
24     void unserialize( void* contiguous_vector, void *noncontiguous_vector,
25                               int count, MPI_Op op);
26 };
27
28 class Type_Vector: public Datatype{
29   private:
30     int block_count_;
31     int block_length_;
32     int block_stride_;
33     MPI_Datatype old_type_;
34   public:
35     Type_Vector(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int stride, MPI_Datatype old_type);
36     ~Type_Vector();
37     void serialize( void* noncontiguous, void *contiguous,
38                             int count);
39     void unserialize( void* contiguous_vector, void *noncontiguous_vector,
40                               int count, MPI_Op op);
41 };
42
43 class Type_Hvector: public Datatype{
44   private:
45     int block_count_;
46     int block_length_;
47     MPI_Aint block_stride_;
48     MPI_Datatype old_type_;
49   public:
50     Type_Hvector(int size,MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int block_length, MPI_Aint block_stride, MPI_Datatype old_type);
51     ~Type_Hvector();
52     void serialize( void* noncontiguous, void *contiguous,
53                             int count);
54     void unserialize( void* contiguous_vector, void *noncontiguous_vector,
55                               int count, MPI_Op op);
56 };
57
58 class Type_Indexed: public Datatype{
59   private:
60     int block_count_;
61     int* block_lengths_;
62     int* block_indices_;
63     MPI_Datatype old_type_;
64   public:
65     Type_Indexed(int size,MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, int* block_indices, MPI_Datatype old_type);
66     ~Type_Indexed();
67     void serialize( void* noncontiguous, void *contiguous,
68                             int count);
69     void unserialize( void* contiguous_vector, void *noncontiguous_vector,
70                               int count, MPI_Op op);
71 };
72
73 class Type_Hindexed: public Datatype{
74   private:
75     int block_count_;
76     int* block_lengths_;
77     MPI_Aint* block_indices_;
78     MPI_Datatype old_type_;
79   public:
80     Type_Hindexed(int size,MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, MPI_Aint* block_indices, MPI_Datatype old_type);
81     ~Type_Hindexed();
82     void serialize( void* noncontiguous, void *contiguous,
83                             int count);
84     void unserialize( void* contiguous_vector, void *noncontiguous_vector,
85                               int count, MPI_Op op);
86 };
87
88 class Type_Struct: public Datatype{
89   private:
90     int block_count_;
91     int* block_lengths_;
92     MPI_Aint* block_indices_;
93     MPI_Datatype* old_types_;
94   public:
95     Type_Struct(int size,MPI_Aint lb, MPI_Aint ub, int flags, int block_count, int* block_lengths, MPI_Aint* block_indices, MPI_Datatype* old_types);
96     ~Type_Struct();
97     void serialize( void* noncontiguous, void *contiguous,
98                             int count);
99     void unserialize( void* contiguous_vector, void *noncontiguous_vector,
100                               int count, MPI_Op op);
101 };
102
103
104 }
105 }
106
107 #endif