Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid
[simgrid.git] / src / smpi / smpi_group.hpp
1 /* Copyright (c) 2010, 2013-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_GROUP_HPP_INCLUDED
8 #define SMPI_GROUP_HPP_INCLUDED
9
10 #include "src/smpi/smpi_f2c.hpp"
11
12 namespace simgrid{
13 namespace smpi{
14
15 class Group : public F2C{
16   private:
17     int size_;
18     int *rank_to_index_map_;
19     xbt_dict_t index_to_rank_map_;
20     int refcount_;
21   public:
22     Group();
23     Group(int size);
24     Group(Group* origin);
25     ~Group();
26
27     void set_mapping(int index, int rank);
28     int index(int rank);
29     int rank(int index);
30     void ref();
31     static void unref(MPI_Group group);
32     int size();
33     int compare(MPI_Group group2);
34     int incl(int n, int* ranks, MPI_Group* newgroup);
35     int excl(int n, int *ranks, MPI_Group * newgroup);
36     int group_union(MPI_Group group2, MPI_Group* newgroup);
37     int intersection(MPI_Group group2, MPI_Group* newgroup);
38     int difference(MPI_Group group2, MPI_Group* newgroup);
39     int range_incl(int n, int ranges[][3], MPI_Group * newgroup);
40     int range_excl(int n, int ranges[][3], MPI_Group * newgroup);
41
42     static Group* f2c(int id);
43
44 };
45 }
46 }
47
48 #endif