Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8185d5c37e808ba33efa0ad24fadbe14aa920222
[simgrid.git] / src / smpi / smpi_win.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_WIN_HPP_INCLUDED
8 #define SMPI_WIN_HPP_INCLUDED
9
10 #include "private.h"
11 #include <vector>
12
13 namespace simgrid{
14 namespace smpi{
15
16 class Win : public F2C, public Keyval {
17   private :
18   void* base_;
19   MPI_Aint size_;
20   int disp_unit_;
21   int assert_;
22   MPI_Info info_;
23   MPI_Comm comm_;
24   std::vector<MPI_Request> *requests_;
25   xbt_mutex_t mut_;
26   msg_bar_t bar_;
27   MPI_Win* connected_wins_;
28   char* name_;
29   int opened_;
30   MPI_Group group_;
31   int count_; //for ordering the accs
32
33 public:
34   static std::unordered_map<int, smpi_key_elem> keyvals_;
35   static int keyval_id_;
36
37   Win(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm);
38   ~Win();
39   void get_name( char* name, int* length);
40   void get_group( MPI_Group* group);
41   void set_name( char* name);
42   int start(MPI_Group group, int assert);
43   int post(MPI_Group group, int assert);
44   int complete();
45   int wait();
46   MPI_Aint size();
47   void* base();
48   int disp_unit();
49   int fence(int assert);
50   int put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
51               MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype);
52   int get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
53               MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype);
54   int accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
55               MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op);
56   static Win* f2c(int id);
57 };
58
59
60 }
61 }
62
63 #endif