int my_f2c_id_ = -1;
protected:
- static std::unordered_map<int, F2C*>* f2c_lookup() { return f2c_lookup_; }
static void set_f2c_lookup(std::unordered_map<int, F2C*>* map) { f2c_lookup_ = map; }
static int f2c_id() { return f2c_id_; }
static void f2c_id_increment() { f2c_id_++; }
return MPI_COMM_SELF;
} else if(id==0){
return MPI_COMM_WORLD;
- } else if(F2C::f2c_lookup() != nullptr && id >= 0) {
- const auto& lookup = F2C::f2c_lookup();
+ } else if (F2C::lookup() != nullptr && id >= 0) {
+ const auto& lookup = F2C::lookup();
auto comm = lookup->find(id);
return comm == lookup->end() ? MPI_COMM_NULL : static_cast<MPI_Comm>(comm->second);
} else {
}
void Comm::free_f(int id) {
- F2C::f2c_lookup()->erase(id);
+ F2C::lookup()->erase(id);
}
void Comm::add_rma_win(MPI_Win win){
namespace smpi{
MPI_Errhandler Errhandler::f2c(int id) {
- if(F2C::f2c_lookup() != nullptr && id >= 0) {
- return static_cast<MPI_Errhandler>(F2C::f2c_lookup()->at(id));
+ if (F2C::lookup() != nullptr && id >= 0) {
+ return static_cast<MPI_Errhandler>(F2C::lookup()->at(id));
} else {
return MPI_ERRHANDLER_NULL;
}
MPI_Group Group::f2c(int id) {
if(id == -2) {
return MPI_GROUP_EMPTY;
- } else if(F2C::f2c_lookup() != nullptr && id >= 0) {
- return static_cast<MPI_Group>(F2C::f2c_lookup()->at(id));
+ } else if (F2C::lookup() != nullptr && id >= 0) {
+ return static_cast<MPI_Group>(F2C::lookup()->at(id));
} else {
return MPI_GROUP_NULL;
}
{
if(id==MPI_FORTRAN_REQUEST_NULL)
return MPI_REQUEST_NULL;
- return static_cast<MPI_Request>(F2C::f2c_lookup()->at(id));
+ return static_cast<MPI_Request>(F2C::lookup()->at(id));
}
void Request::free_f(int id)
{
if (id != MPI_FORTRAN_REQUEST_NULL) {
- F2C::f2c_lookup()->erase(id);
+ F2C::lookup()->erase(id);
}
}