Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bring C++ for MPI_Group.
[simgrid.git] / src / smpi / smpi_group.hpp
1 /* Copyright (c) 2010, 2013-2015. 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 #include "private.h"
8
9 namespace simgrid{
10 namespace SMPI{
11
12 class Group {
13   private:
14     int m_size;
15     int *m_rank_to_index_map;
16     xbt_dict_t m_index_to_rank_map;
17     int m_refcount;
18   public:
19
20     Group();
21     Group(int size);
22     Group(Group* origin);
23     ~Group();
24
25     void destroy();
26     void set_mapping(int index, int rank);
27     int index(int rank);
28     int rank(int index);
29     int use();
30     int unuse();
31     int getsize();
32     int compare(MPI_Group group2);
33     int incl(int n, int* ranks, MPI_Group* newgroup);
34     int excl(int n, int *ranks, MPI_Group * newgroup);
35     int group_union(MPI_Group group2, MPI_Group* newgroup);
36     int intersection(MPI_Group group2, MPI_Group* newgroup);
37     int difference(MPI_Group group2, MPI_Group* newgroup);
38     int range_incl(int n, int ranges[][3], MPI_Group * newgroup);
39     int range_excl(int n, int ranges[][3], MPI_Group * newgroup);
40 };
41 }
42 }