Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ok, I stop trying to please sonar.
[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 serialize( void* noncontiguous, void *contiguous, 
25                             int count);
26     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
27                               int count, MPI_Op op);
28 };
29
30 class Type_Vector: public Datatype{
31   private:
32     int block_count_;
33     int block_length_;
34     int block_stride_;
35     MPI_Datatype old_type_;
36   public:
37     Type_Vector(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int stride, MPI_Datatype old_type);
38     ~Type_Vector();
39     void serialize( void* noncontiguous, void *contiguous, 
40                             int count);
41     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
42                               int count, MPI_Op op);
43 };
44
45 class Type_Hvector: public Datatype{
46   private:
47     int block_count_;
48     int block_length_;
49     MPI_Aint block_stride_;
50     MPI_Datatype old_type_;
51   public:
52     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);
53     ~Type_Hvector();
54     void serialize( void* noncontiguous, void *contiguous, 
55                             int count);
56     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
57                               int count, MPI_Op op);
58 };
59
60 class Type_Indexed: public Datatype{
61   private:
62     int block_count_;
63     int* block_lengths_;
64     int* block_indices_;
65     MPI_Datatype old_type_;
66   public:
67     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);
68     ~Type_Indexed();
69     void serialize( void* noncontiguous, void *contiguous, 
70                             int count);
71     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
72                               int count, MPI_Op op);
73 };
74
75 class Type_Hindexed: public Datatype{
76   private:
77     int block_count_;
78     int* block_lengths_;
79     MPI_Aint* block_indices_;
80     MPI_Datatype old_type_;
81   public:
82     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);
83     ~Type_Hindexed();
84     void serialize( void* noncontiguous, void *contiguous, 
85                             int count);
86     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
87                               int count, MPI_Op op);
88 };
89
90 class Type_Struct: public Datatype{
91   private:
92     int block_count_;
93     int* block_lengths_;
94     MPI_Aint* block_indices_;
95     MPI_Datatype* old_types_;
96   public:
97     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);
98     ~Type_Struct();
99     void serialize( void* noncontiguous, void *contiguous, 
100                             int count);
101     void unserialize( void* contiguous_vector, void *noncontiguous_vector, 
102                               int count, MPI_Op op);
103 };
104
105
106 }
107 }
108
109 #endif