Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce the amount of includes
[simgrid.git] / src / smpi / 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 <xbt/base.h>
11
12 #include "private.h"
13 #include "src/smpi/smpi_datatype.hpp"
14
15 namespace simgrid{
16 namespace smpi{
17
18 class Type_Contiguous: public Datatype {
19   private:
20     int block_count_;
21     MPI_Datatype old_type_;
22   public:
23     Type_Contiguous(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, MPI_Datatype old_type);
24     ~Type_Contiguous();
25     void serialize( void* noncontiguous, void *contiguous, 
26                             int count);
27     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
28                               int count, MPI_Op op);
29 };
30
31 class Type_Vector: public Datatype{
32   private:
33     int block_count_;
34     int block_length_;
35     int block_stride_;
36     MPI_Datatype old_type_;
37   public:
38     Type_Vector(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int stride, MPI_Datatype old_type);
39     ~Type_Vector();
40     void serialize( void* noncontiguous, void *contiguous, 
41                             int count);
42     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
43                               int count, MPI_Op op);
44 };
45
46 class Type_Hvector: public Datatype{
47   private:
48     int block_count_;
49     int block_length_;
50     MPI_Aint block_stride_;
51     MPI_Datatype old_type_;
52   public:
53     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);
54     ~Type_Hvector();
55     void serialize( void* noncontiguous, void *contiguous, 
56                             int count);
57     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
58                               int count, MPI_Op op);
59 };
60
61 class Type_Indexed: public Datatype{
62   private:
63     int block_count_;
64     int* block_lengths_;
65     int* block_indices_;
66     MPI_Datatype old_type_;
67   public:
68     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);
69     ~Type_Indexed();
70     void serialize( void* noncontiguous, void *contiguous, 
71                             int count);
72     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
73                               int count, MPI_Op op);
74 };
75
76 class Type_Hindexed: public Datatype{
77   private:
78     int block_count_;
79     int* block_lengths_;
80     MPI_Aint* block_indices_;
81     MPI_Datatype old_type_;
82   public:
83     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);
84     ~Type_Hindexed();
85     void serialize( void* noncontiguous, void *contiguous, 
86                             int count);
87     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
88                               int count, MPI_Op op);
89 };
90
91 class Type_Struct: public Datatype{
92   private:
93     int block_count_;
94     int* block_lengths_;
95     MPI_Aint* block_indices_;
96     MPI_Datatype* old_types_;
97   public:
98     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);
99     ~Type_Struct();
100     void serialize( void* noncontiguous, void *contiguous, 
101                             int count);
102     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
103                               int count, MPI_Op op);
104 };
105
106
107 }
108 }
109
110 #endif