1 /* Copyright (c) 2010, 2013-2017. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #ifndef SMPI_WIN_HPP_INCLUDED
8 #define SMPI_WIN_HPP_INCLUDED
17 class Win : public F2C, public Keyval {
25 std::vector<MPI_Request> *requests_;
28 MPI_Win* connected_wins_;
32 int count_; //for ordering the accs
33 xbt_mutex_t lock_mut_;
34 std::list<int> lockers_;
35 int rank_; // to identify owner for barriers in MPI_COMM_WORLD
36 int mode_; // exclusive or shared lock
41 static std::unordered_map<int, smpi_key_elem> keyvals_;
42 static int keyval_id_;
44 Win(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, int allocated = 0, int dynamic = 0);
45 Win(MPI_Info info, MPI_Comm comm) : Win(MPI_BOTTOM, 0, 1, info, comm, 0, 1) {};
47 int attach (void *base, MPI_Aint size);
48 int detach (void *base);
49 void get_name( char* name, int* length);
50 void get_group( MPI_Group* group);
51 void set_name( char* name);
54 int start(MPI_Group group, int assert);
55 int post(MPI_Group group, int assert);
58 void set_info( MPI_Info info);
63 int fence(int assert);
64 int put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
65 MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype);
66 int get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
67 MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype);
68 int accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
69 MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op);
70 int get_accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
71 int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count,
72 MPI_Datatype target_datatype, MPI_Op op);
73 static Win* f2c(int id);
74 int lock(int lock_type, int rank, int assert);