Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'smpi_cpp'
[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 #ifndef SMPI_GROUP_HPP_INCLUDED
8 #define SMPI_GROUP_HPP_INCLUDED
9
10 #include "private.h"
11
12 namespace simgrid{
13 namespace SMPI{
14
15 class Group {
16   private:
17     int m_size;
18     int *m_rank_to_index_map;
19     xbt_dict_t m_index_to_rank_map;
20     int m_refcount;
21   public:
22
23     Group();
24     Group(int size);
25     Group(Group* origin);
26     ~Group();
27
28     void destroy();
29     void set_mapping(int index, int rank);
30     int index(int rank);
31     int rank(int index);
32     int use();
33     int unuse();
34     int size();
35     int compare(MPI_Group group2);
36     int incl(int n, int* ranks, MPI_Group* newgroup);
37     int excl(int n, int *ranks, MPI_Group * newgroup);
38     int group_union(MPI_Group group2, MPI_Group* newgroup);
39     int intersection(MPI_Group group2, MPI_Group* newgroup);
40     int difference(MPI_Group group2, MPI_Group* newgroup);
41     int range_incl(int n, int ranges[][3], MPI_Group * newgroup);
42     int range_excl(int n, int ranges[][3], MPI_Group * newgroup);
43 };
44 }
45 }
46
47 #endif