Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix warnings + refactor
[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   int block_count_;
17   MPI_Datatype old_type_;
18
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, int count);
23   void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
24 };
25
26 class Type_Vector: public Datatype{
27   int block_count_;
28   int block_length_;
29   int block_stride_;
30   MPI_Datatype old_type_;
31
32 public:
33   Type_Vector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, int blocklen, int stride,
34               MPI_Datatype old_type);
35   ~Type_Vector();
36   void serialize(void* noncontiguous, void* contiguous, int count);
37   void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
38 };
39
40 class Type_Hvector: public Datatype{
41   int block_count_;
42   int block_length_;
43   MPI_Aint block_stride_;
44   MPI_Datatype old_type_;
45
46 public:
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);
49   ~Type_Hvector();
50   void serialize(void* noncontiguous, void* contiguous, int count);
51   void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
52 };
53
54 class Type_Indexed: public Datatype{
55   int block_count_;
56   int* block_lengths_;
57   int* block_indices_;
58   MPI_Datatype old_type_;
59
60 public:
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);
63   ~Type_Indexed();
64   void serialize(void* noncontiguous, void* contiguous, int count);
65   void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
66 };
67
68 class Type_Hindexed: public Datatype{
69   int block_count_;
70   int* block_lengths_;
71   MPI_Aint* block_indices_;
72   MPI_Datatype old_type_;
73
74 public:
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);
77   ~Type_Hindexed();
78   void serialize(void* noncontiguous, void* contiguous, int count);
79   void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
80 };
81
82 class Type_Struct: public Datatype{
83   int block_count_;
84   int* block_lengths_;
85   MPI_Aint* block_indices_;
86   MPI_Datatype* old_types_;
87
88 public:
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);
91   ~Type_Struct();
92   void serialize(void* noncontiguous, void* contiguous, int count);
93   void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
94 };
95
96
97 }
98 }
99
100 #endif