-/* Copyright (c) 2010-2020. The SimGrid Team.
+/* Copyright (c) 2010-2021. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "smpi_errhandler.hpp"
#include "smpi_f2c.hpp"
#include "smpi_keyvals.hpp"
-#include "xbt/synchro.h"
#include <vector>
#include <list>
int assert_ = 0;
MPI_Info info_;
MPI_Comm comm_;
- std::vector<MPI_Request> *requests_;
- s4u::MutexPtr mut_;
- s4u::Barrier* bar_;
- MPI_Win* connected_wins_;
- char* name_;
- int opened_;
- MPI_Group group_;
- int count_; //for ordering the accs
- s4u::MutexPtr lock_mut_;
- s4u::MutexPtr atomic_mut_;
+ std::vector<MPI_Request> requests_;
+ s4u::MutexPtr mut_ = s4u::Mutex::create();
+ s4u::Barrier* bar_ = nullptr;
+ std::vector<MPI_Win> connected_wins_;
+ std::string name_;
+ int opened_ = 0;
+ MPI_Group group_ = MPI_GROUP_NULL;
+ int count_ = 0; // for ordering the accs
+ s4u::MutexPtr lock_mut_ = s4u::Mutex::create();
+ s4u::MutexPtr atomic_mut_ = s4u::Mutex::create();
std::list<int> lockers_;
int rank_; // to identify owner for barriers in MPI_COMM_WORLD
- int mode_; // exclusive or shared lock
+ int mode_ = 0; // exclusive or shared lock
int allocated_;
int dynamic_;
- MPI_Errhandler errhandler_;
+ MPI_Errhandler errhandler_ = MPI_ERRORS_ARE_FATAL;
public:
static std::unordered_map<int, smpi_key_elem> keyvals_;
Win(MPI_Info info, MPI_Comm comm) : Win(MPI_BOTTOM, 0, 1, info, comm, 0, 1) {};
Win(const Win&) = delete;
Win& operator=(const Win&) = delete;
- ~Win();
+ ~Win() override;
int attach (void *base, MPI_Aint size);
int detach (const void *base);
- void get_name( char* name, int* length);
+ void get_name(char* name, int* length) const;
void get_group( MPI_Group* group);
void set_name(const char* name);
- int rank();
- int dynamic();
+ int rank() const;
+ MPI_Comm comm() const;
+ int dynamic() const;
int start(MPI_Group group, int assert);
int post(MPI_Group group, int assert);
int complete();
MPI_Info info();
void set_info( MPI_Info info);
int wait();
- MPI_Aint size();
- void* base();
- int disp_unit();
+ MPI_Aint size() const;
+ void* base() const;
+ int disp_unit() const;
int fence(int assert);
int put(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Request* request=nullptr);
int flush_local_all();
int finish_comms();
int finish_comms(int rank);
- int shared_query(int rank, MPI_Aint* size, int* disp_unit, void* baseptr);
+ int shared_query(int rank, MPI_Aint* size, int* disp_unit, void* baseptr) const;
MPI_Errhandler errhandler();
void set_errhandler( MPI_Errhandler errhandler);
};