Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move derived datatypes to their own file.
[simgrid.git] / src / smpi / smpi_datatype_derived.hpp
1 /* Copyright (c) 2009-2010, 2012-2014. 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
14 namespace simgrid{
15 namespace smpi{
16
17 class Type_Contiguous: public Datatype{
18   private:
19     int block_count_;
20     MPI_Datatype old_type_;
21   public:
22     Type_Contiguous(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, MPI_Datatype old_type);
23     ~Type_Contiguous();
24     void use();
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 use();
41     void serialize( void* noncontiguous, void *contiguous, 
42                             int count);
43     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
44                               int count, MPI_Op op);
45 };
46
47 class Type_Hvector: public Datatype{
48   private:
49     int block_count_;
50     int block_length_;
51     MPI_Aint block_stride_;
52     MPI_Datatype old_type_;
53   public:
54     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);
55     ~Type_Hvector();
56     void use();
57     void serialize( void* noncontiguous, void *contiguous, 
58                             int count);
59     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
60                               int count, MPI_Op op);
61 };
62
63 class Type_Indexed: public Datatype{
64   private:
65     int block_count_;
66     int* block_lengths_;
67     int* block_indices_;
68     MPI_Datatype old_type_;
69   public:
70     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);
71     ~Type_Indexed();
72     void use();
73     void serialize( void* noncontiguous, void *contiguous, 
74                             int count);
75     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
76                               int count, MPI_Op op);
77 };
78
79 class Type_Hindexed: public Datatype{
80   private:
81     int block_count_;
82     int* block_lengths_;
83     MPI_Aint* block_indices_;
84     MPI_Datatype old_type_;
85   public:
86     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);
87     ~Type_Hindexed();
88     void use();
89     void serialize( void* noncontiguous, void *contiguous, 
90                             int count);
91     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
92                               int count, MPI_Op op);
93 };
94
95 class Type_Struct: public Datatype{
96   private:
97     int block_count_;
98     int* block_lengths_;
99     MPI_Aint* block_indices_;
100     MPI_Datatype* old_types_;
101   public:
102     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);
103     ~Type_Struct();
104     void use();
105     void serialize( void* noncontiguous, void *contiguous, 
106                             int count);
107     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
108                               int count, MPI_Op op);
109 };
110
111
112 }
113 }
114
115 #endif